diff --git a/src/lex_utils.cc b/src/lex_utils.cc index 49fa40cb..ba99e818 100644 --- a/src/lex_utils.cc +++ b/src/lex_utils.cc @@ -79,7 +79,8 @@ void DecorateIncludePaths(const std::smatch& match, for (lsCompletionItem& item : *items) { 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; } } diff --git a/src/messages/text_document_completion.cc b/src/messages/text_document_completion.cc index 65e4cf9e..69224d72 100644 --- a/src/messages/text_document_completion.cc +++ b/src/messages/text_document_completion.cc @@ -255,9 +255,8 @@ struct TextDocumentCompletionHandler : MessageHandler { } // Needed by |FilterAndSortCompletionResponse|. - // Will be removed in |DecorateIncludePaths|. for (lsCompletionItem& item : out.result.items) - item.label = "include" + item.label; + item.filterText = "include" + item.label; FilterAndSortCompletionResponse(&out, result.text, config->completion.filterAndSort);