From 76f6b44443b3e205a35b8a224c1bfb7aa29ae057 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 9 Jan 2018 17:32:00 +0000 Subject: [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 --- clang-tools-extra/clangd/CodeComplete.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'clang-tools-extra/clangd/CodeComplete.cpp') 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; } -- cgit v1.2.3