summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorFrancois Belair <razoric480@gmail.com>2021-12-04 10:52:47 -0500
committerFrancois Belair <razoric480@gmail.com>2021-12-04 10:58:05 -0500
commit66f1b4bf66caca3d8237dcedaa68799994e888c5 (patch)
tree889a351cc45688f0668deb1f893255893597cf09 /modules/gdscript
parent2a9dd654bc0197dd864df61b5b37e302022c2871 (diff)
Prevent LSP adding signal func to non GDScripts
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp
index 932bfb2caa..9be9cbc749 100644
--- a/modules/gdscript/language_server/gdscript_workspace.cpp
+++ b/modules/gdscript/language_server/gdscript_workspace.cpp
@@ -54,9 +54,13 @@ void GDScriptWorkspace::_bind_methods() {
}
void GDScriptWorkspace::apply_new_signal(Object *obj, String function, PackedStringArray args) {
- String function_signature = "func " + function;
Ref<Script> script = obj->get_script();
+ if (script->get_language()->get_name() != "GDScript") {
+ return;
+ }
+
+ String function_signature = "func " + function;
String source = script->get_source_code();
if (source.find(function_signature) != -1) {