diff --git a/README.md b/README.md index f7f8d42..a8993bd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/build.bat b/build.bat index 35660b9..fc86f4b 100644 --- a/build.bat +++ b/build.bat @@ -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 + diff --git a/editors/textadept/modules/dmd/dcd.lua b/editors/textadept/modules/dmd/dcd.lua index 3849dc9..e03cb64 100644 --- a/editors/textadept/modules/dmd/dcd.lua +++ b/editors/textadept/modules/dmd/dcd.lua @@ -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 diff --git a/stupidlog.d b/stupidlog.d index dc78a57..091b488 100644 --- a/stupidlog.d +++ b/stupidlog.d @@ -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; }