Browse Source

Language client: minor improvement to completion result parsing

pipelines/235045657
eidheim 5 years ago
parent
commit
24b1688003
  1. 2
      src/source_language_protocol.cpp

2
src/source_language_protocol.cpp

@ -1628,7 +1628,7 @@ void Source::LanguageProtocolView::setup_autocomplete() {
insert = label; insert = label;
if(!insert.empty()) { if(!insert.empty()) {
auto kind = it->second.get<int>("kind", 0); auto kind = it->second.get<int>("kind", 0);
if(kind >= 2 && kind <= 3 && insert.find('(') == std::string::npos) // If kind is method or function, but parentheses are missing if(kind >= 2 && kind <= 4 && insert.find('(') == std::string::npos) // If kind is method, function or constructor, but parentheses are missing
insert += "(${1:})"; insert += "(${1:})";
autocomplete->rows.emplace_back(std::move(label)); autocomplete->rows.emplace_back(std::move(label));
autocomplete_rows.emplace_back(AutocompleteRow{std::move(insert), std::move(detail), std::move(documentation), std::move(documentation_kind)}); autocomplete_rows.emplace_back(AutocompleteRow{std::move(insert), std::move(detail), std::move(documentation), std::move(documentation_kind)});

Loading…
Cancel
Save