summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/index/Index.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-01-09 17:32:00 +0000
committerEric Liu <ioeric@google.com>2018-01-09 17:32:00 +0000
commit76f6b44443b3e205a35b8a224c1bfb7aa29ae057 (patch)
tree46a91efe4b1fa3cb98dad5f5170270b5ee166b27 /clang-tools-extra/clangd/index/Index.cpp
parent7d9bef8f5cf007af067d668fa1be86edf50e50c2 (diff)
downloadbcm5719-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/index/Index.cpp')
-rw-r--r--clang-tools-extra/clangd/index/Index.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/index/Index.cpp b/clang-tools-extra/clangd/index/Index.cpp
index 6d26dc849d2..7f598643423 100644
--- a/clang-tools-extra/clangd/index/Index.cpp
+++ b/clang-tools-extra/clangd/index/Index.cpp
@@ -55,6 +55,23 @@ static void own(Symbol &S, DenseSet<StringRef> &Strings,
Intern(S.Name);
Intern(S.Scope);
Intern(S.CanonicalDeclaration.FilePath);
+
+ Intern(S.CompletionLabel);
+ Intern(S.CompletionFilterText);
+ Intern(S.CompletionPlainInsertText);
+ Intern(S.CompletionSnippetInsertText);
+
+ if (S.Detail) {
+ // Copy values of StringRefs into arena.
+ auto *Detail = Arena.Allocate<Symbol::Details>();
+ Detail->Documentation = S.Detail->Documentation;
+ Detail->CompletionDetail = S.Detail->CompletionDetail;
+ S.Detail = Detail;
+
+ // Intern the actual strings.
+ Intern(S.Detail->Documentation);
+ Intern(S.Detail->CompletionDetail);
+ }
}
void SymbolSlab::Builder::insert(const Symbol &S) {
OpenPOWER on IntegriCloud