summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/language_server/gdscript_language_protocol.cpp
diff options
context:
space:
mode:
authorBooksBaum <15612932+Booksbaum@users.noreply.github.com>2023-07-28 17:06:08 +0200
committerryanabx <ryanbrue@hotmail.com>2023-09-11 09:46:34 -0500
commit0202a36a7a0eb76dec9814728e30e00074dc7bb2 (patch)
tree1628450e38be206c3b951652a7934f5a740c2888 /modules/gdscript/language_server/gdscript_language_protocol.cpp
parent221884e6bc260c38f16422081b7d4efd49a71375 (diff)
downloadredot-engine-0202a36a7a0eb76dec9814728e30e00074dc7bb2.tar.gz
Language Server: Improve hovered symbol resolution, fix renaming bugs, implement reference lookup
Co-Authored-By: Ryan Brue <56272643+ryanabx@users.noreply.github.com> Co-Authored-By: BooksBaum <15612932+booksbaum@users.noreply.github.com>
Diffstat (limited to 'modules/gdscript/language_server/gdscript_language_protocol.cpp')
-rw-r--r--modules/gdscript/language_server/gdscript_language_protocol.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp
index 112db4df3a..14fc21d7dc 100644
--- a/modules/gdscript/language_server/gdscript_language_protocol.cpp
+++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp
@@ -278,6 +278,11 @@ void GDScriptLanguageProtocol::stop() {
}
void GDScriptLanguageProtocol::notify_client(const String &p_method, const Variant &p_params, int p_client_id) {
+#ifdef TESTS_ENABLED
+ if (clients.is_empty()) {
+ return;
+ }
+#endif
if (p_client_id == -1) {
ERR_FAIL_COND_MSG(latest_client_id == -1,
"GDScript LSP: Can't notify client as none was connected.");
@@ -294,6 +299,11 @@ void GDScriptLanguageProtocol::notify_client(const String &p_method, const Varia
}
void GDScriptLanguageProtocol::request_client(const String &p_method, const Variant &p_params, int p_client_id) {
+#ifdef TESTS_ENABLED
+ if (clients.is_empty()) {
+ return;
+ }
+#endif
if (p_client_id == -1) {
ERR_FAIL_COND_MSG(latest_client_id == -1,
"GDScript LSP: Can't notify client as none was connected.");