Code Editor: Add documentation tooltips

This commit is contained in:
Danil Alexeev 2024-12-14 21:25:05 +03:00
parent 863a24ac86
commit 80d11500b5
No known key found for this signature in database
GPG key ID: 5A52F75A8679EC57
30 changed files with 1398 additions and 586 deletions

View file

@ -699,12 +699,12 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
symbol_identifier = "_init";
}
if (OK == GDScriptLanguage::get_singleton()->lookup_code(parser->get_text_for_lookup_symbol(pos, symbol_identifier, p_func_required), symbol_identifier, path, nullptr, ret)) {
if (ret.type == ScriptLanguage::LOOKUP_RESULT_SCRIPT_LOCATION) {
if (ret.location >= 0) {
String target_script_path = path;
if (!ret.script.is_null()) {
if (ret.script.is_valid()) {
target_script_path = ret.script->get_path();
} else if (!ret.class_path.is_empty()) {
target_script_path = ret.class_path;
} else if (!ret.script_path.is_empty()) {
target_script_path = ret.script_path;
}
if (const ExtendGDScriptParser *target_parser = get_parse_result(target_script_path)) {
@ -720,7 +720,6 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
}
}
}
} else {
String member = ret.class_member;
if (member.is_empty() && symbol_identifier != ret.class_name) {