Symbols that call a function aren't relevant for the completion list

This commit is contained in:
RUSShyTwo 2021-11-22 21:41:20 +01:00 committed by GitHub
parent 2bfd3d004f
commit 4eda366db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -664,7 +664,18 @@ bool mightBeRelevantInCompletionScope(const DSymbol* symbol, Scope* scope_)
// scope is the scope of the current file so if the symbol is not in there, it's not accessible
return false;
}
if (symbol.kind == CompletionKind.functionName && !symbol.type)
{
// if it's a function and is isn't represented by a type
// that mean it is a symbol that calls the function
// so we can just ignore it
// eg:
// void test(){}
//
// te <--- cursor here, the symbol will be the line bellow, it's useless, just show the actual function
// test();
return false;
}
return true;
}