mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 09:31:59 +00:00
Always include literal completions
This commit is contained in:
parent
706479aded
commit
25d450cf8b
@ -473,15 +473,26 @@ void FilterCompletionResponse(Out_TextDocumentComplete* complete_response,
|
|||||||
else {
|
else {
|
||||||
NonElidedVector<lsCompletionItem> filtered_result;
|
NonElidedVector<lsCompletionItem> filtered_result;
|
||||||
filtered_result.reserve(kMaxResultSize);
|
filtered_result.reserve(kMaxResultSize);
|
||||||
|
|
||||||
for (const lsCompletionItem& item : complete_response->result.items) {
|
for (const lsCompletionItem& item : complete_response->result.items) {
|
||||||
if (SubstringMatch(complete_text, item.label)) {
|
if (item.label.find(complete_text) != std::string::npos) {
|
||||||
//std::cerr << "!! emitting " << item.label << std::endl;
|
|
||||||
filtered_result.push_back(item);
|
filtered_result.push_back(item);
|
||||||
if (filtered_result.size() >= kMaxResultSize)
|
if (filtered_result.size() >= kMaxResultSize)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filtered_result.size() < kMaxResultSize) {
|
||||||
|
for (const lsCompletionItem& item : complete_response->result.items) {
|
||||||
|
if (SubstringMatch(complete_text, item.label)) {
|
||||||
|
//std::cerr << "!! emitting " << item.label << std::endl;
|
||||||
|
filtered_result.push_back(item);
|
||||||
|
if (filtered_result.size() >= kMaxResultSize)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
complete_response->result.items = filtered_result;
|
complete_response->result.items = filtered_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user