Prevent LSP adding signal func to non GDScripts

(cherry picked from commit 66f1b4bf66)
This commit is contained in:
Francois Belair 2021-12-04 10:52:47 -05:00 committed by Rémi Verschelde
parent 8ba1b94187
commit 97958e2a38
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -53,9 +53,13 @@ void GDScriptWorkspace::_bind_methods() {
}
void GDScriptWorkspace::apply_new_signal(Object *obj, String function, PoolStringArray 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) {