mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LanguageServers/Cpp: Don't include declarations bellow the current line
This commit is contained in:
parent
b82a00d657
commit
9288dfced8
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);
|
available_names.append(name);
|
||||||
};
|
};
|
||||||
for (auto& decl : available_declarations) {
|
for (auto& decl : available_declarations) {
|
||||||
|
if (decl.filename() == node.filename() && decl.start().line > node.start().line)
|
||||||
|
continue;
|
||||||
if (decl.is_variable_or_parameter_declaration()) {
|
if (decl.is_variable_or_parameter_declaration()) {
|
||||||
add_name(((Cpp::VariableOrParameterDeclaration&)decl).m_name);
|
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()) {
|
if (expression.is_member_expression()) {
|
||||||
auto& member_expression = (const MemberExpression&)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()) {
|
if (!expression.is_identifier()) {
|
||||||
VERIFY_NOT_REACHED(); // TODO
|
VERIFY_NOT_REACHED(); // TODO
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue