Skip to content

Commit

Permalink
Fix include completion with filterText.
Browse files Browse the repository at this point in the history
  • Loading branch information
scturtle committed Feb 6, 2018
1 parent 2a9e0b4 commit 1e3815d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lex_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/messages/text_document_completion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e3815d

Please sign in to comment.