diff options
author | Geequlim <geequlim@gmail.com> | 2019-06-25 18:09:42 +0800 |
---|---|---|
committer | geequlim <geequlim@gmail.com> | 2019-08-11 13:30:15 +0800 |
commit | 9618b0c63e3330865350bd8bbc6a9d2faf9dd26c (patch) | |
tree | 78893c850a12bc7b72af45dc2e3b129db0bb6ddc /modules/gdscript/language_server/gdscript_language_protocol.cpp | |
parent | b2f02317fabe284220c74c21229e4cad6ab74e93 (diff) |
Check client workspace directory is valid
Drop test initialize message sent to client
Remove unused code property for the parser class
Diffstat (limited to 'modules/gdscript/language_server/gdscript_language_protocol.cpp')
-rw-r--r-- | modules/gdscript/language_server/gdscript_language_protocol.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 7fb336cc58..9ebabc276e 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -103,7 +103,18 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) { if (root_uri.length() && is_same_workspace) { workspace.root_uri = root_uri; } else { + workspace.root_uri = "file://" + workspace.root; + + Dictionary params; + params["path"] = workspace.root; + Dictionary request = make_notification("gdscrip_client/changeWorkspace", params); + if (Ref<WebSocketPeer> *peer = clients.getptr(lastest_client_id)) { + String msg = JSON::print(request); + msg = format_output(msg); + CharString charstr = msg.utf8(); + (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length()); + } } if (!_initialized) { @@ -116,18 +127,6 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) { } void GDScriptLanguageProtocol::initialized(const Variant &p_params) { - - Dictionary params; - params["type"] = 3; - params["message"] = "GDScript Language Server initialized!"; - Dictionary test_message = make_notification("window/showMessage", params); - - if (Ref<WebSocketPeer> *peer = clients.getptr(lastest_client_id)) { - String msg = JSON::print(test_message); - msg = format_output(msg); - CharString charstr = msg.utf8(); - (*peer)->put_packet((const uint8_t *)charstr.ptr(), charstr.length()); - } } void GDScriptLanguageProtocol::poll() { |