diff options
| author | Eric Liu <ioeric@google.com> | 2018-01-09 17:32:00 +0000 |
|---|---|---|
| committer | Eric Liu <ioeric@google.com> | 2018-01-09 17:32:00 +0000 |
| commit | 76f6b44443b3e205a35b8a224c1bfb7aa29ae057 (patch) | |
| tree | 46a91efe4b1fa3cb98dad5f5170270b5ee166b27 /clang-tools-extra/clangd/CodeComplete.cpp | |
| parent | 7d9bef8f5cf007af067d668fa1be86edf50e50c2 (diff) | |
| download | bcm5719-llvm-76f6b44443b3e205a35b8a224c1bfb7aa29ae057.tar.gz bcm5719-llvm-76f6b44443b3e205a35b8a224c1bfb7aa29ae057.zip | |
[clangd] Add more symbol information for code completion.
Reviewers: hokein, sammccall
Reviewed By: sammccall
Subscribers: klimek, ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D41345
llvm-svn: 322097
Diffstat (limited to 'clang-tools-extra/clangd/CodeComplete.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 93588b49289..ee709021f9c 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -556,16 +556,19 @@ CompletionItem indexCompletionItem(const Symbol &Sym, llvm::StringRef Filter, Item.kind = toCompletionItemKind(Sym.SymInfo.Kind); Item.label = Sym.Name; // FIXME(ioeric): support inserting/replacing scope qualifiers. - Item.insertText = Sym.Name; + // FIXME(ioeric): support snippets. + Item.insertText = Sym.CompletionPlainInsertText; Item.insertTextFormat = InsertTextFormat::PlainText; Item.filterText = Sym.Name; // FIXME(ioeric): sort symbols appropriately. Item.sortText = ""; - // FIXME(ioeric): use more symbol information (e.g. documentation, label) to - // populate the completion item. + if (Sym.Detail) { + Item.documentation = Sym.Detail->Documentation; + Item.detail = Sym.Detail->CompletionDetail; + } return Item; } |

