Conflicts:
	README.md
This commit is contained in:
Hackerpilot 2013-11-07 14:03:21 -08:00
commit 9971f08513
4 changed files with 51 additions and 15 deletions

View File

@ -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.
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
#Server

View File

@ -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 -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 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 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

View File

@ -113,6 +113,7 @@ function M.gotoDeclaration()
p:close()
local tmpFile = io.open(fileName, "r")
local r = tmpFile:read("*a")
io.close(tmpFile)
if r ~= "Not found\n" then
path, position = r:match("^(.-)\t(%d+)")
if (path ~= nil and position ~= nil) then

View File

@ -36,37 +36,70 @@ struct Log
static void trace(T...)(T args)
{
if (level < LogLevel.trace) return;
if (output is stdout)
output.writeln("[\033[01;36mtrace\033[0m] ", args);
else
version(Windows)
{
output.writeln("[trace] ", args);
return;
}
else
{
if (output is stdout)
output.writeln("[\033[01;36mtrace\033[0m] ", args);
else
output.writeln("[trace] ", args);
}
}
static void info(T...)(T args)
{
if (level < LogLevel.info) return;
if (output is stdout)
output.writeln("[\033[01;32minfo\033[0m ] ", args);
else
version (Windows)
{
output.writeln("[info ] ", args);
return;
}
else
{
if (output is stdout)
output.writeln("[\033[01;32minfo\033[0m ] ", args);
else
output.writeln("[info ] ", args);
}
}
static void error(T...)(T args)
{
if (level < LogLevel.error) return;
if (output is stdout)
output.writeln("[\033[01;31merror\033[0m] ", args);
else
version(Windows)
{
output.writeln("[error] ", args);
return;
}
else
{
if (output is stdout)
output.writeln("[\033[01;31merror\033[0m] ", args);
else
output.writeln("[error] ", args);
}
}
static void fatal(T...)(T args)
{
if (output is stdout)
output.writeln("[\033[01;35mfatal\033[0m] ", args);
else
version(Windows)
{
output.writeln("[fatal] ", args);
return;
}
else
{
if (output is stdout)
output.writeln("[\033[01;35mfatal\033[0m] ", args);
else
output.writeln("[fatal] ", args);
}
}
static LogLevel level;
static File output;
}