Rank same-document completion candidates first
Candidates carry a local flag set from the index record path, and the deterministic sort key orders local candidates before remote ones within the same kind. Registered feature tests cover the ranking.
This commit is contained in:
1 parent
0b33a0cd99
commit
236c3c5718
5 files changed
+29
-16
No files matched your search
@@ -996,12 +996,14 @@ Json EditorDiagnostics::completion(std::string_view uri, Documents::Position pos
|
||||
? features::completion::Kind::namespace_
|
||||
: record.kind == index::SymbolKind::module ? features::completion::Kind::module
|
||||
: features::completion::Kind::unknown;
|
||||
candidates.push_back({record.name,
|
||||
kind,
|
||||
record.location.path,
|
||||
record.provenance,
|
||||
{record.name, record.location.path, record.location.line,
|
||||
record.location.character}});
|
||||
candidates.push_back(
|
||||
{record.name,
|
||||
kind,
|
||||
record.location.path,
|
||||
record.provenance,
|
||||
{record.name, record.location.path, record.location.line,
|
||||
record.location.character},
|
||||
record.location.path == snapshot->identity.canonical_path.native()});
|
||||
}
|
||||
}
|
||||
const std::uint64_t generation = s.symbols.generation();
|
||||
|
||||
Reference in new issue
Block a user