diff options
author | Francois Belair <razoric480@gmail.com> | 2021-12-04 10:52:47 -0500 |
---|---|---|
committer | Francois Belair <razoric480@gmail.com> | 2021-12-04 10:58:05 -0500 |
commit | 66f1b4bf66caca3d8237dcedaa68799994e888c5 (patch) | |
tree | 889a351cc45688f0668deb1f893255893597cf09 | |
parent | 2a9dd654bc0197dd864df61b5b37e302022c2871 (diff) |
Prevent LSP adding signal func to non GDScripts
-rw-r--r-- | modules/gdscript/language_server/gdscript_workspace.cpp | 6 |
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) { |