mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 00:43:46 +00:00
lsp: Send godot class tree to clients
This commit is contained in:
parent
bb41f0b0cb
commit
1ab34bc3c2
2 changed files with 52 additions and 1 deletions
|
@ -134,6 +134,22 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
|
|||
}
|
||||
|
||||
void GDScriptLanguageProtocol::initialized(const Variant &p_params) {
|
||||
|
||||
lsp::GodotCapabilities capabilities;
|
||||
|
||||
DocData *doc = EditorHelp::get_doc_data();
|
||||
for (Map<String, DocData::ClassDoc>::Element *E = doc->class_list.front(); E; E = E->next()) {
|
||||
|
||||
lsp::GodotNativeClassInfo gdclass;
|
||||
gdclass.name = E->get().name;
|
||||
gdclass.class_doc = &(E->get());
|
||||
if (ClassDB::ClassInfo *ptr = ClassDB::classes.getptr(StringName(E->get().name))) {
|
||||
gdclass.class_info = ptr;
|
||||
}
|
||||
capabilities.native_classes.push_back(gdclass);
|
||||
}
|
||||
|
||||
notify_client("gdscript/capabilities", capabilities.to_json());
|
||||
}
|
||||
|
||||
void GDScriptLanguageProtocol::poll() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue