-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDScriptLanguageProtocol singleton not properly recognized as identifier #52162
Comments
This is because The syntax highlighter should likely have custom code to handle singletons specifically, and not just classes.
That one is weird as it seems to be properly registered as singleton. It's registered in the Core API when it should likely be in the Editor API only (only available in diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp
index 12ed56a568..63b305ad82 100644
--- a/modules/gdscript/language_server/gdscript_language_server.cpp
+++ b/modules/gdscript/language_server/gdscript_language_server.cpp
@@ -106,7 +106,9 @@ void GDScriptLanguageServer::stop() {
}
void register_lsp_types() {
+ ClassDB::set_current_api(ClassDB::API_EDITOR);
ClassDB::register_class<GDScriptLanguageProtocol>();
ClassDB::register_class<GDScriptTextDocument>();
ClassDB::register_class<GDScriptWorkspace>();
+ ClassDB::set_current_api(ClassDB::API_CORE);
} But that doesn't solve the GDScript error when trying to use the identifier in a |
The The There's now an issue with |
Follow-up to godotengine#51916, fixes inconsistency between singleton name and class as documented in godotengine#52162 (comment).
This is fixed by #52656, so I repurposed this issue to focus only on the |
It seems the issue is that this class and its singleton are registered in the godot/modules/gdscript/register_types.cpp Lines 136 to 147 in 8a21121
But this is called quite late, which makes it doesn't appear on the editor help for instance. When running the project this is never called so the class don't get registered all, hence the error. This registration code should probably be moved to the |
Follow-up to #51916, fixes inconsistency between singleton name and class as documented in godotengine/godot#52162 (comment).
Godot version
3.4.beta3
System information
Windows 10
Issue description
NavigationMeshGenerator
singleton is not displayed green.GDScriptLanguageProtocol
singleton Identifier not found: GDScriptLanguageProtocolSteps to reproduce
Minimal reproduction project
N-A
The text was updated successfully, but these errors were encountered: