Fix include completion with filterText.

Fix #423
This commit is contained in:
Chao Shen 2018-02-06 16:14:05 +08:00
parent 2a9e0b4575
commit 1e3815db2d
2 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,8 @@ void DecorateIncludePaths(const std::smatch& match,
for (lsCompletionItem& item : *items) { for (lsCompletionItem& item : *items) {
item.textEdit->newText = prefix + item.textEdit->newText + suffix; item.textEdit->newText = prefix + item.textEdit->newText + suffix;
item.label = prefix + item.label.substr(7) + suffix; item.label = prefix + item.label + suffix;
item.filterText = item.label;
} }
} }

View File

@ -255,9 +255,8 @@ struct TextDocumentCompletionHandler : MessageHandler {
} }
// Needed by |FilterAndSortCompletionResponse|. // Needed by |FilterAndSortCompletionResponse|.
// Will be removed in |DecorateIncludePaths|.
for (lsCompletionItem& item : out.result.items) for (lsCompletionItem& item : out.result.items)
item.label = "include" + item.label; item.filterText = "include" + item.label;
FilterAndSortCompletionResponse(&out, result.text, FilterAndSortCompletionResponse(&out, result.text,
config->completion.filterAndSort); config->completion.filterAndSort);