From 5cba44be86dee6ae9034b825a13091784bc11442 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 6 Nov 2013 19:08:57 -0800 Subject: [PATCH 1/3] Windows! --- build.bat | 5 +++-- stupidlog.d | 57 ++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 48 insertions(+), 14 deletions(-) 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/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; } From 623f4f060af9d17ae8cfe56b8cf8332d0596b097 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 6 Nov 2013 19:16:19 -0800 Subject: [PATCH 2/3] Fixed markup in go-to-symbol example --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1045ca6..07d27f5 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, folled by a newline character. For example +followed by the byte offset, folled by a newline character. For example: + /home/example/src/project/bar.d 3482 #Server From 22cceff7d5d9ecc31f8bf985e15d8a0488d0beb5 Mon Sep 17 00:00:00 2001 From: Kelet Date: Thu, 7 Nov 2013 14:21:53 -0500 Subject: [PATCH 3/3] Close temporary file used in going to declaration --- editors/textadept/modules/dmd/dcd.lua | 1 + 1 file changed, 1 insertion(+) 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