LanguageServers/Cpp: Autocomplete function and struct/class names

This commit is contained in:
Itamar 2021-02-10 21:46:25 +02:00 committed by Andreas Kling
commit 64c80f6ea4
Notes: sideshowbarker 2024-07-18 22:26:23 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -143,6 +143,12 @@ Vector<GUI::AutocompleteProvider::Entry> ParserAutoComplete::autocomplete_identi
if (decl.is_variable_or_parameter_declaration()) {
add_name(((Cpp::VariableOrParameterDeclaration&)decl).m_name);
}
if (decl.is_struct_or_class()) {
add_name(((Cpp::StructOrClassDeclaration&)decl).m_name);
}
if (decl.is_function()) {
add_name(((Cpp::FunctionDeclaration&)decl).m_name);
}
}
auto partial_text = document.parser.text_of_node(node);