Merge branch 'master' of https://github.com/Hackerpilot/DCD
This commit is contained in:
commit
cdc57193d1
49
build.bat
49
build.bat
|
@ -1,3 +1,48 @@
|
||||||
dmd -wi client.d messages.d stupidlog.d msgpack-d/src/msgpack.d -Imsgpack-d/src -release -inline -O -ofdcd-client -L/EXETYPE:NT -L/SUBSYSTEM:WINDOWS
|
del /f containers\src\std\allocator.d
|
||||||
|
|
||||||
|
dmd^
|
||||||
|
client.d^
|
||||||
|
messages.d^
|
||||||
|
stupidlog.d^
|
||||||
|
msgpack-d/src/msgpack.d^
|
||||||
|
-Imsgpack-d/src^
|
||||||
|
-release -inline -O -wi^
|
||||||
|
-ofdcd-client
|
||||||
|
|
||||||
|
dmd^
|
||||||
|
actypes.d^
|
||||||
|
conversion/astconverter.d^
|
||||||
|
conversion/first.d^
|
||||||
|
conversion/second.d^
|
||||||
|
conversion/third.d^
|
||||||
|
autocomplete.d^
|
||||||
|
constants.d^
|
||||||
|
messages.d^
|
||||||
|
modulecache.d^
|
||||||
|
semantic.d^
|
||||||
|
server.d^
|
||||||
|
stupidlog.d^
|
||||||
|
string_interning.d^
|
||||||
|
libdparse/src/std/d/ast.d^
|
||||||
|
libdparse/src/std/d/entities.d^
|
||||||
|
libdparse/src/std/d/lexer.d^
|
||||||
|
libdparse/src/std/d/parser.d^
|
||||||
|
libdparse/src/std/lexer.d^
|
||||||
|
libdparse/src/std/allocator.d^
|
||||||
|
libdparse/src/std/d/formatter.d^
|
||||||
|
containers/src/memory/allocators.d^
|
||||||
|
containers/src/memory/appender.d^
|
||||||
|
containers/src/containers/dynamicarray.d^
|
||||||
|
containers/src/containers/ttree.d^
|
||||||
|
containers/src/containers/unrolledlist.d^
|
||||||
|
containers/src/containers/hashset.d^
|
||||||
|
containers/src/containers/internal/hash.d^
|
||||||
|
containers/src/containers/internal/node.d^
|
||||||
|
containers/src/containers/slist.d^
|
||||||
|
msgpack-d/src/msgpack.d^
|
||||||
|
-Icontainers/src^
|
||||||
|
-Imsgpack-d/src^
|
||||||
|
-Ilibdparse/src^
|
||||||
|
-wi -O -release^
|
||||||
|
-ofdcd-server
|
||||||
|
|
||||||
dmd actypes.d conversion/astconverter.d conversion/first.d conversion/second.d conversion/third.d autocomplete.d constants.d messages.d modulecache.d semantic.d server.d stupidlog.d string_interning.d dscanner/std/d/ast.d dscanner/std/d/entities.d dscanner/std/d/lexer.d dscanner/std/d/parser.d dscanner/std/lexer.d dscanner/std/allocator.d dscanner/formatter.d containers/src/memory/appender.d containers/src/memory/allocators.d containers/src/containers/dynamicarray.d containers/src/containers/ttree.d containers/src/containers/hashset.d containers/src/containers/unrolledlist.d containers/src/containers/internal/hash.d msgpack-d/src/msgpack.d -Icontainers/src -Imsgpack-d/src -Idscanner -wi -g -O -release -ofdcd-server
|
|
||||||
|
|
4
build.sh
4
build.sh
|
@ -42,7 +42,7 @@ dmd\
|
||||||
msgpack-d/src/msgpack.d\
|
msgpack-d/src/msgpack.d\
|
||||||
-Icontainers/src\
|
-Icontainers/src\
|
||||||
-Imsgpack-d/src\
|
-Imsgpack-d/src\
|
||||||
-Idscanner\
|
-Ilibdparse/src\
|
||||||
-wi -O -release -inline\
|
-wi -O -release -inline\
|
||||||
-ofdcd-server
|
-ofdcd-server
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ dmd\
|
||||||
# dscanner/formatter.d\
|
# dscanner/formatter.d\
|
||||||
# msgpack-d/src/msgpack.d\
|
# msgpack-d/src/msgpack.d\
|
||||||
# -Imsgpack-d/src\
|
# -Imsgpack-d/src\
|
||||||
# -Idscanner\
|
# -Ilibdparse/src\
|
||||||
# -O3 -frelease -fno-bounds-check\
|
# -O3 -frelease -fno-bounds-check\
|
||||||
# -odcd-server
|
# -odcd-server
|
||||||
|
|
||||||
|
|
2
client.d
2
client.d
|
@ -225,6 +225,8 @@ AutocompleteResponse getResponse(TcpSocket socket)
|
||||||
auto bytesReceived = socket.receive(buffer);
|
auto bytesReceived = socket.receive(buffer);
|
||||||
if (bytesReceived == Socket.ERROR)
|
if (bytesReceived == Socket.ERROR)
|
||||||
throw new Exception("Incorrect number of bytes received");
|
throw new Exception("Incorrect number of bytes received");
|
||||||
|
if (bytesReceived == 0)
|
||||||
|
throw new Exception("Server closed the connection, 0 bytes received");
|
||||||
AutocompleteResponse response;
|
AutocompleteResponse response;
|
||||||
msgpack.unpack(buffer[0..bytesReceived], response);
|
msgpack.unpack(buffer[0..bytesReceived], response);
|
||||||
return response;
|
return response;
|
||||||
|
|
|
@ -150,21 +150,19 @@ If you want to restart server, use `ac-dcd-init-server' instead."
|
||||||
|
|
||||||
|
|
||||||
;; utility functions to call process
|
;; utility functions to call process
|
||||||
|
(defun ac-dcd-call-process (prefix &rest args)
|
||||||
(defun ac-dcd-call-process (prefix args)
|
(if (null ac-dcd-executable)
|
||||||
(let ((buf (get-buffer-create ac-dcd-output-buffer-name))
|
(error (format "Could not find dcd-client executable"))
|
||||||
res)
|
(let ((buf (get-buffer-create "*dcd-output*"))
|
||||||
(with-current-buffer buf (erase-buffer))
|
res)
|
||||||
(setq res (apply 'call-process-region (point-min) (point-max)
|
(with-current-buffer buf (erase-buffer))
|
||||||
ac-dcd-executable nil buf nil
|
(setq res (apply 'call-process-region (point-min) (point-max)
|
||||||
args
|
ac-dcd-executable nil buf nil args))
|
||||||
))
|
(with-current-buffer buf
|
||||||
(with-current-buffer buf
|
(unless (eq 0 res)
|
||||||
(goto-char (point-min))
|
(ac-dcd-handle-error res args))
|
||||||
(when (re-search-forward ac-dcd-error-message-regexp nil t)
|
;; Still try to get any useful input.
|
||||||
(ac-dcd-handle-error res args))
|
(ac-dcd-parse-output prefix)))))
|
||||||
;; Still try to get any useful input.
|
|
||||||
(ac-dcd-parse-output prefix))))
|
|
||||||
|
|
||||||
(defsubst ac-dcd-cursor-position ()
|
(defsubst ac-dcd-cursor-position ()
|
||||||
"Get cursor position to pass to dcd-client.
|
"Get cursor position to pass to dcd-client.
|
||||||
|
|
|
@ -101,6 +101,8 @@ struct ModuleCache
|
||||||
{
|
{
|
||||||
foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))
|
foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))
|
||||||
{
|
{
|
||||||
|
import std.path: baseName;
|
||||||
|
if(fileName.baseName.startsWith(".#")) continue;
|
||||||
getSymbolsInModule(fileName);
|
getSymbolsInModule(fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
server.d
2
server.d
|
@ -157,7 +157,7 @@ int main(string[] args)
|
||||||
}
|
}
|
||||||
if (request.kind & RequestKind.addImport)
|
if (request.kind & RequestKind.addImport)
|
||||||
ModuleCache.addImportPaths(request.importPaths);
|
ModuleCache.addImportPaths(request.importPaths);
|
||||||
else if (request.kind & RequestKind.autocomplete)
|
if (request.kind & RequestKind.autocomplete)
|
||||||
{
|
{
|
||||||
Log.info("Getting completions");
|
Log.info("Getting completions");
|
||||||
AutocompleteResponse response = complete(request);
|
AutocompleteResponse response = complete(request);
|
||||||
|
|
Loading…
Reference in New Issue