Merge pull request #114534 from HolonProduction/rm-lsp-dead-code
LSP: Remove unused `ExtendGDScriptParser::get_member_completions`
This commit is contained in:
@@ -859,30 +859,6 @@ const List<LSP::DocumentLink> &ExtendGDScriptParser::get_document_links() const
|
||||
return document_links;
|
||||
}
|
||||
|
||||
const Array &ExtendGDScriptParser::get_member_completions() {
|
||||
if (member_completions.is_empty()) {
|
||||
for (const KeyValue<String, const LSP::DocumentSymbol *> &E : members) {
|
||||
const LSP::DocumentSymbol *symbol = E.value;
|
||||
LSP::CompletionItem item = symbol->make_completion_item();
|
||||
item.data = JOIN_SYMBOLS(path, E.key);
|
||||
member_completions.push_back(item.to_json());
|
||||
}
|
||||
|
||||
for (const KeyValue<String, ClassMembers> &E : inner_classes) {
|
||||
const ClassMembers *inner_class = &E.value;
|
||||
|
||||
for (const KeyValue<String, const LSP::DocumentSymbol *> &F : *inner_class) {
|
||||
const LSP::DocumentSymbol *symbol = F.value;
|
||||
LSP::CompletionItem item = symbol->make_completion_item();
|
||||
item.data = JOIN_SYMBOLS(path, JOIN_SYMBOLS(E.key, F.key));
|
||||
member_completions.push_back(item.to_json());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return member_completions;
|
||||
}
|
||||
|
||||
Dictionary ExtendGDScriptParser::dump_function_api(const GDScriptParser::FunctionNode *p_func) const {
|
||||
ERR_FAIL_NULL_V(p_func, Dictionary());
|
||||
Dictionary func;
|
||||
|
||||
@@ -42,14 +42,6 @@
|
||||
#define COLUMN_NUMBER_TO_INDEX(p_column) ((p_column) - 1)
|
||||
#endif
|
||||
|
||||
#ifndef SYMBOL_SEPARATOR
|
||||
#define SYMBOL_SEPARATOR "::"
|
||||
#endif
|
||||
|
||||
#ifndef JOIN_SYMBOLS
|
||||
#define JOIN_SYMBOLS(p_path, name) ((p_path) + SYMBOL_SEPARATOR + (name))
|
||||
#endif
|
||||
|
||||
typedef HashMap<String, const LSP::DocumentSymbol *> ClassMembers;
|
||||
|
||||
/**
|
||||
@@ -134,8 +126,6 @@ class ExtendGDScriptParser : public GDScriptParser {
|
||||
|
||||
const LSP::DocumentSymbol *search_symbol_defined_at_line(int p_line, const LSP::DocumentSymbol &p_parent, const String &p_symbol_name = "") const;
|
||||
|
||||
Array member_completions;
|
||||
|
||||
public:
|
||||
_FORCE_INLINE_ const String &get_path() const { return path; }
|
||||
_FORCE_INLINE_ const Vector<String> &get_lines() const { return lines; }
|
||||
|
||||
@@ -293,33 +293,6 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) {
|
||||
if (data.get_type() == Variant::DICTIONARY) {
|
||||
params.load(p_params["data"]);
|
||||
symbol = GDScriptLanguageProtocol::get_singleton()->get_workspace()->resolve_symbol(params, item.label, item.kind == LSP::CompletionItemKind::Method || item.kind == LSP::CompletionItemKind::Function);
|
||||
|
||||
} else if (data.is_string()) {
|
||||
String query = data;
|
||||
|
||||
Vector<String> param_symbols = query.split(SYMBOL_SEPARATOR, false);
|
||||
|
||||
if (param_symbols.size() >= 2) {
|
||||
StringName class_name = param_symbols[0];
|
||||
const String &member_name = param_symbols[param_symbols.size() - 1];
|
||||
String inner_class_name;
|
||||
if (param_symbols.size() >= 3) {
|
||||
inner_class_name = param_symbols[1];
|
||||
}
|
||||
|
||||
if (const ClassMembers *members = GDScriptLanguageProtocol::get_singleton()->get_workspace()->native_members.getptr(class_name)) {
|
||||
if (const LSP::DocumentSymbol *const *member = members->getptr(member_name)) {
|
||||
symbol = *member;
|
||||
}
|
||||
}
|
||||
|
||||
if (!symbol) {
|
||||
ExtendGDScriptParser *parser = GDScriptLanguageProtocol::get_singleton()->get_parse_result(class_name);
|
||||
if (parser) {
|
||||
symbol = parser->get_member_symbol(member_name, inner_class_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (symbol) {
|
||||
|
||||
Reference in New Issue
Block a user