Merge branch 'master' of https://github.com/Hackerpilot/DCD
This commit is contained in:
commit
49578a49aa
|
|
@ -20,10 +20,8 @@ back to the client.
|
|||
* *import* statement completions
|
||||
* Not working:
|
||||
* Automatic starting of the server by the client
|
||||
* Windows support (I don't know that it won't work, but this program is not tested on Windows yet)
|
||||
* UFCS
|
||||
* Autocompletion of declarations with template arguments
|
||||
* Fields inherited from super classes or implemented interfaces.
|
||||
* *auto* declarations
|
||||
* *alias this*
|
||||
* Determining the type of an enum member when no base type is specified, but the first member has an initialaizer
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ static this()
|
|||
{
|
||||
s.parts ~= alignof_;
|
||||
s.parts ~= new ACSymbol("dig", CompletionKind.keyword, s);
|
||||
s.parts ~= new ACSymbol("episilon", CompletionKind.keyword, s);
|
||||
s.parts ~= new ACSymbol("epsilon", CompletionKind.keyword, s);
|
||||
s.parts ~= new ACSymbol("infinity", CompletionKind.keyword, s);
|
||||
s.parts ~= new ACSymbol("init", CompletionKind.keyword, s);
|
||||
s.parts ~= mangleof_;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
dmd -wi client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -ofdcd-client -L/exet:nt/su:windows:4.0
|
||||
dmd -wi -g server.d modulecache.d actypes.d messages.d constants.d acvisitor.d autocomplete.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner/ -ofdcd-server
|
||||
43
client.d
43
client.d
|
|
@ -27,11 +27,48 @@ import std.algorithm;
|
|||
import std.path;
|
||||
import std.file;
|
||||
import std.conv;
|
||||
|
||||
//version(Windows)
|
||||
//{
|
||||
// import core.runtime;
|
||||
// import core.sys.windows.windows;
|
||||
// import std.string;
|
||||
//}
|
||||
import msgpack;
|
||||
import messages;
|
||||
|
||||
int main(string[] args)
|
||||
//version(Windows)
|
||||
//{
|
||||
// extern(Windows) int WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
// {
|
||||
// int result;
|
||||
// void exceptionHandler(Throwable e) {
|
||||
// throw e;
|
||||
// }
|
||||
// try
|
||||
// {
|
||||
// Runtime.
|
||||
// Runtime.initialize(&exceptionHandler);
|
||||
// result = _main(["dcd-client"] ~ to!string(lpCmdLine).split(" ").array());
|
||||
// Runtime.terminate(&exceptionHandler);
|
||||
// }
|
||||
// catch (Throwable e) // catch any uncaught exceptions
|
||||
// {
|
||||
// MessageBoxA(null, e.toString().toStringz(), "Error",
|
||||
// MB_OK | MB_ICONEXCLAMATION);
|
||||
// result = 0; // failed
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// int main(string[] args)
|
||||
// {
|
||||
// return _main(args);
|
||||
// }
|
||||
//}
|
||||
|
||||
int /*_*/main(string[] args)
|
||||
{
|
||||
size_t cursorPos = size_t.max;
|
||||
string[] importPaths;
|
||||
|
|
@ -104,7 +141,7 @@ int main(string[] args)
|
|||
string fileName = usingStdin ? "stdin" : args[1];
|
||||
if (!usingStdin && !exists(args[1]))
|
||||
{
|
||||
stderr.writefln("%s does not exist");
|
||||
stderr.writefln("%s does not exist", args[1]);
|
||||
return 1;
|
||||
}
|
||||
File f = usingStdin ? stdin : File(args[1]);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ function M.autocomplete(ch)
|
|||
if buffer:get_lexer() ~= "dmd" then return end
|
||||
local fileName = os.tmpname()
|
||||
local command = M.PATH_TO_DCD_CLIENT .. " -c" .. buffer.current_pos .. " > " .. fileName
|
||||
local p = io.popen(command, "w")
|
||||
local p = io.popen(command, "wb")
|
||||
p:write(buffer:get_text())
|
||||
p:flush()
|
||||
p:close()
|
||||
|
|
|
|||
29
server.d
29
server.d
|
|
@ -34,11 +34,11 @@ import modulecache;
|
|||
|
||||
version(Posix)
|
||||
{
|
||||
enum CONFIG_FILE_PATH = "~/.config/dcd";
|
||||
enum CONFIG_FILE_PATH = "~/.config/dcd";
|
||||
}
|
||||
else version(Windows)
|
||||
{
|
||||
enum CONFIG_FILE_PATH = "dcd.conf";
|
||||
enum CONFIG_FILE_PATH = "dcd.conf";
|
||||
}
|
||||
|
||||
int main(string[] args)
|
||||
|
|
@ -143,19 +143,20 @@ int main(string[] args)
|
|||
|
||||
string[] loadConfiguredImportDirs()
|
||||
{
|
||||
version(Windows)
|
||||
{
|
||||
string fullPath = buildPath(getcwd(), CONFIG_FILE_PATH);
|
||||
}
|
||||
else version(Posix)
|
||||
{
|
||||
string fullPath = expandTilde(CONFIG_FILE_PATH);
|
||||
}
|
||||
version(Windows)
|
||||
{
|
||||
string fullPath = buildPath(getcwd(), CONFIG_FILE_PATH);
|
||||
}
|
||||
else version(Posix)
|
||||
{
|
||||
string fullPath = expandTilde(CONFIG_FILE_PATH);
|
||||
}
|
||||
|
||||
if (!exists(fullPath))
|
||||
return [];
|
||||
File f = File(fullPath);
|
||||
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
|
||||
if (!exists(fullPath))
|
||||
return [];
|
||||
|
||||
File f = File(fullPath, "rt");
|
||||
return f.byLine(KeepTerminator.no).map!(a => a.idup).filter!(a => a.exists()).array();
|
||||
}
|
||||
|
||||
void printHelp(string programName)
|
||||
|
|
|
|||
Loading…
Reference in New Issue