summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-01-30 09:21:30 +0000
committerSam McCall <sam.mccall@gmail.com>2018-01-30 09:21:30 +0000
commitea283c7bb84439a4d71290289bbe3c58a08a77f2 (patch)
treee2084cfa6c3a5ea97d0394893b0f5ff3d900bc30
parentf72e8653722512e3d157c607c6cbfd8223855770 (diff)
downloadbcm5719-llvm-ea283c7bb84439a4d71290289bbe3c58a08a77f2.tar.gz
bcm5719-llvm-ea283c7bb84439a4d71290289bbe3c58a08a77f2.zip
[clangd] Enable completion index by default, limit results to 100.
Summary: This should speed up global code completion by avoiding deserializing preamble declarations to look up names. The tradeoff is memory usage. Currently the index is fairly naive and may not be much faster, but there's lots of performance headroom. These two changes go together because results from the index get copied a couple of times, so we should avoid it for huge sets. Also the flag should be -completion-limit, rather than -limit-completion. Reviewers: hokein, ioeric, ilya-biryukov Subscribers: klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D42669 llvm-svn: 323734
-rw-r--r--clang-tools-extra/clangd/tool/ClangdMain.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 2d965198f89..12a52a31c81 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -87,10 +87,10 @@ static llvm::cl::opt<PCHStorageFlag> PCHStorage(
llvm::cl::init(PCHStorageFlag::Disk));
static llvm::cl::opt<int> LimitCompletionResult(
- "limit-completion",
+ "completion-limit",
llvm::cl::desc("Limit the number of completion results returned by clangd. "
"0 means no limit."),
- llvm::cl::init(0));
+ llvm::cl::init(100));
static llvm::cl::opt<bool> RunSynchronously(
"run-synchronously",
@@ -117,9 +117,9 @@ static llvm::cl::opt<Path> TraceFile(
static llvm::cl::opt<bool> EnableIndexBasedCompletion(
"enable-index-based-completion",
llvm::cl::desc(
- "Enable index-based global code completion (experimental). Clangd will "
- "use index built from symbols in opened files"),
- llvm::cl::init(false), llvm::cl::Hidden);
+ "Enable index-based global code completion. "
+ "Clang uses an index built from symbols in opened files"),
+ llvm::cl::init(true));
static llvm::cl::opt<Path> YamlSymbolFile(
"yaml-symbol-file",
OpenPOWER on IntegriCloud