mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 11:00:29 +00:00
LanguageServers/Cpp: Don't include declarations bellow the current line
This commit is contained in:
parent
b82a00d657
commit
9288dfced8
Notes:
sideshowbarker
2024-07-18 20:42:37 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/9288dfced81 Pull-request: https://github.com/SerenityOS/serenity/pull/6009
1 changed files with 5 additions and 1 deletions
|
@ -146,6 +146,8 @@ Vector<GUI::AutocompleteProvider::Entry> ParserAutoComplete::autocomplete_name(c
|
|||
available_names.append(name);
|
||||
};
|
||||
for (auto& decl : available_declarations) {
|
||||
if (decl.filename() == node.filename() && decl.start().line > node.start().line)
|
||||
continue;
|
||||
if (decl.is_variable_or_parameter_declaration()) {
|
||||
add_name(((Cpp::VariableOrParameterDeclaration&)decl).m_name);
|
||||
}
|
||||
|
@ -241,7 +243,9 @@ String ParserAutoComplete::type_of(const DocumentData& document, const Expressio
|
|||
{
|
||||
if (expression.is_member_expression()) {
|
||||
auto& member_expression = (const MemberExpression&)expression;
|
||||
return type_of_property(document, *member_expression.m_property);
|
||||
if (member_expression.m_property->is_identifier())
|
||||
return type_of_property(document, static_cast<const Identifier&>(*member_expression.m_property));
|
||||
return {};
|
||||
}
|
||||
if (!expression.is_identifier()) {
|
||||
VERIFY_NOT_REACHED(); // TODO
|
||||
|
|
Loading…
Reference in a new issue