mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-28 02:21:57 +00:00
Deprioritize completion items with additionTextEdits
This commit is contained in:
parent
32a658ad24
commit
16c2e0643b
@ -227,6 +227,10 @@ void FilterCandidates(lsCompletionList &result,
|
|||||||
items.end());
|
items.end());
|
||||||
std::sort(items.begin(), items.end(),
|
std::sort(items.begin(), items.end(),
|
||||||
[](const lsCompletionItem &lhs, const lsCompletionItem &rhs) {
|
[](const lsCompletionItem &lhs, const lsCompletionItem &rhs) {
|
||||||
|
int t = int(lhs.additionalTextEdits.size() -
|
||||||
|
rhs.additionalTextEdits.size());
|
||||||
|
if (t)
|
||||||
|
return t < 0;
|
||||||
if (lhs.score_ != rhs.score_)
|
if (lhs.score_ != rhs.score_)
|
||||||
return lhs.score_ > rhs.score_;
|
return lhs.score_ > rhs.score_;
|
||||||
if (lhs.priority_ != rhs.priority_)
|
if (lhs.priority_ != rhs.priority_)
|
||||||
|
Loading…
Reference in New Issue
Block a user