Merge branch 'master' of https://github.com/Hackerpilot/DCD
Conflicts: README.md
This commit is contained in:
commit
9971f08513
|
@ -115,7 +115,8 @@ to return the path to the file and the byte offset of the declaration of the
|
||||||
symbol at the given cursor position.
|
symbol at the given cursor position.
|
||||||
|
|
||||||
The output consists of the absolute path to the file followed by a tab character
|
The output consists of the absolute path to the file followed by a tab character
|
||||||
followed by the byte offset, followed by a newline character. For example
|
followed by the byte offset, followed by a newline character. For example:
|
||||||
|
|
||||||
/home/example/src/project/bar.d 3482
|
/home/example/src/project/bar.d 3482
|
||||||
|
|
||||||
#Server
|
#Server
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
dmd -wi client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -ofdcd-client -L/exet:nt/su:windows:4.0
|
dmd client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -release -inline -noboundscheck -O -ofdcd-client -wi -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 dscanner/formatter.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner/ -ofdcd-server
|
dmd actypes.d astconverter.d autocomplete.d constants.d messages.d modulecache.d semantic.d server.d stupidlog.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d dscanner/formatter.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner -wi -g -ofdcd-server
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ function M.gotoDeclaration()
|
||||||
p:close()
|
p:close()
|
||||||
local tmpFile = io.open(fileName, "r")
|
local tmpFile = io.open(fileName, "r")
|
||||||
local r = tmpFile:read("*a")
|
local r = tmpFile:read("*a")
|
||||||
|
io.close(tmpFile)
|
||||||
if r ~= "Not found\n" then
|
if r ~= "Not found\n" then
|
||||||
path, position = r:match("^(.-)\t(%d+)")
|
path, position = r:match("^(.-)\t(%d+)")
|
||||||
if (path ~= nil and position ~= nil) then
|
if (path ~= nil and position ~= nil) then
|
||||||
|
|
33
stupidlog.d
33
stupidlog.d
|
@ -36,37 +36,70 @@ struct Log
|
||||||
static void trace(T...)(T args)
|
static void trace(T...)(T args)
|
||||||
{
|
{
|
||||||
if (level < LogLevel.trace) return;
|
if (level < LogLevel.trace) return;
|
||||||
|
version(Windows)
|
||||||
|
{
|
||||||
|
output.writeln("[trace] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (output is stdout)
|
if (output is stdout)
|
||||||
output.writeln("[\033[01;36mtrace\033[0m] ", args);
|
output.writeln("[\033[01;36mtrace\033[0m] ", args);
|
||||||
else
|
else
|
||||||
output.writeln("[trace] ", args);
|
output.writeln("[trace] ", args);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void info(T...)(T args)
|
static void info(T...)(T args)
|
||||||
{
|
{
|
||||||
if (level < LogLevel.info) return;
|
if (level < LogLevel.info) return;
|
||||||
|
version (Windows)
|
||||||
|
{
|
||||||
|
output.writeln("[info ] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (output is stdout)
|
if (output is stdout)
|
||||||
output.writeln("[\033[01;32minfo\033[0m ] ", args);
|
output.writeln("[\033[01;32minfo\033[0m ] ", args);
|
||||||
else
|
else
|
||||||
output.writeln("[info ] ", args);
|
output.writeln("[info ] ", args);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void error(T...)(T args)
|
static void error(T...)(T args)
|
||||||
{
|
{
|
||||||
if (level < LogLevel.error) return;
|
if (level < LogLevel.error) return;
|
||||||
|
version(Windows)
|
||||||
|
{
|
||||||
|
output.writeln("[error] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (output is stdout)
|
if (output is stdout)
|
||||||
output.writeln("[\033[01;31merror\033[0m] ", args);
|
output.writeln("[\033[01;31merror\033[0m] ", args);
|
||||||
else
|
else
|
||||||
output.writeln("[error] ", args);
|
output.writeln("[error] ", args);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void fatal(T...)(T args)
|
static void fatal(T...)(T args)
|
||||||
|
{
|
||||||
|
version(Windows)
|
||||||
|
{
|
||||||
|
output.writeln("[fatal] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (output is stdout)
|
if (output is stdout)
|
||||||
output.writeln("[\033[01;35mfatal\033[0m] ", args);
|
output.writeln("[\033[01;35mfatal\033[0m] ", args);
|
||||||
else
|
else
|
||||||
output.writeln("[fatal] ", args);
|
output.writeln("[fatal] ", args);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static LogLevel level;
|
static LogLevel level;
|
||||||
static File output;
|
static File output;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue