From 39813939fc7248226ae698ee727d87d1901f6c3a Mon Sep 17 00:00:00 2001 From: geequlim Date: Fri, 4 Oct 2019 19:15:26 +0800 Subject: Fix enumeration value of SymbolKind. Add custom notification 'gdscript/show_native_symbol' to show native symbols in clients. Close client connections when stop gdscript-lsp --- modules/gdscript/language_server/gdscript_language_protocol.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gdscript/language_server/gdscript_language_protocol.cpp') diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index ce3de9bc3b..8a470d9869 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -153,7 +153,12 @@ Error GDScriptLanguageProtocol::start(int p_port) { } void GDScriptLanguageProtocol::stop() { + const int *ptr = NULL; + while (ptr = clients.next(ptr)) { + clients.get(*ptr)->close(); + } server->stop(); + clients.clear(); } void GDScriptLanguageProtocol::notify_all_clients(const String &p_method, const Variant &p_params) { -- cgit v1.2.3 From e199488bc7f8c37e14ea414fd7986272b50f40ff Mon Sep 17 00:00:00 2001 From: geequlim Date: Fri, 4 Oct 2019 20:53:40 +0800 Subject: Add custom api `textDocument/nativeSymbol` to allow inspect native symbols from LSP clients --- modules/gdscript/language_server/gdscript_language_protocol.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/gdscript/language_server/gdscript_language_protocol.cpp') diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 8a470d9869..ae2aaf6aee 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -153,9 +153,10 @@ Error GDScriptLanguageProtocol::start(int p_port) { } void GDScriptLanguageProtocol::stop() { - const int *ptr = NULL; - while (ptr = clients.next(ptr)) { + const int *ptr = clients.next(NULL); + while (ptr) { clients.get(*ptr)->close(); + ptr = clients.next(ptr); } server->stop(); clients.clear(); -- cgit v1.2.3