From e235dbedfe0e7e16f2b0f6d6a04814d74d23722a Mon Sep 17 00:00:00 2001 From: Chao Shen Date: Fri, 23 Mar 2018 12:48:58 +0800 Subject: [PATCH] Fix missing include completions. --- src/messages/text_document_completion.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/messages/text_document_completion.cc b/src/messages/text_document_completion.cc index d6db3107..8378539f 100644 --- a/src/messages/text_document_completion.cc +++ b/src/messages/text_document_completion.cc @@ -303,15 +303,12 @@ struct Handler_TextDocumentCompletion : MessageHandler { include_complete->completion_items_mutex, std::defer_lock); if (include_complete->is_scanning) lock.lock(); - std::string quote = result.match[5]; - for (auto& item : include_complete->completion_items) - if (quote.empty() || quote == (item.use_angle_brackets_ ? "<" : "\"")) - out.result.items.push_back(item); + out.result.items = include_complete->completion_items; } // Needed by |FilterAndSortCompletionResponse|. for (lsCompletionItem& item : out.result.items) - item.filterText = item.label; + item.filterText = "include" + item.label; FilterAndSortCompletionResponse(&out, result.pattern, config->completion.filterAndSort);