[PATCH] D42669: [clangd] Enable completion index by default, limit results to 100.

2018-01-30 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL323734: [clangd] Enable completion index by default, limit 
results to 100. (authored by sammccall, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D42669

Files:
  clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp


Index: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
@@ -87,10 +87,10 @@
 llvm::cl::init(PCHStorageFlag::Disk));
 
 static llvm::cl::opt 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 RunSynchronously(
 "run-synchronously",
@@ -117,9 +117,9 @@
 static llvm::cl::opt 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 YamlSymbolFile(
 "yaml-symbol-file",


Index: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
@@ -87,10 +87,10 @@
 llvm::cl::init(PCHStorageFlag::Disk));
 
 static llvm::cl::opt 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 RunSynchronously(
 "run-synchronously",
@@ -117,9 +117,9 @@
 static llvm::cl::opt 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 YamlSymbolFile(
 "yaml-symbol-file",
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D42669: [clangd] Enable completion index by default, limit results to 100.

2018-01-30 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision.
ioeric added a comment.

Woohoo!


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42669



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D42669: [clangd] Enable completion index by default, limit results to 100.

2018-01-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42669



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D42669: [clangd] Enable completion index by default, limit results to 100.

2018-01-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision.
sammccall added reviewers: hokein, ioeric, ilya-biryukov.
Herald added subscribers: cfe-commits, jkorous-apple, klimek.

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.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42669

Files:
  clangd/tool/ClangdMain.cpp


Index: clangd/tool/ClangdMain.cpp
===
--- clangd/tool/ClangdMain.cpp
+++ clangd/tool/ClangdMain.cpp
@@ -87,10 +87,10 @@
 llvm::cl::init(PCHStorageFlag::Disk));
 
 static llvm::cl::opt 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 RunSynchronously(
 "run-synchronously",
@@ -117,9 +117,9 @@
 static llvm::cl::opt 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 YamlSymbolFile(
 "yaml-symbol-file",


Index: clangd/tool/ClangdMain.cpp
===
--- clangd/tool/ClangdMain.cpp
+++ clangd/tool/ClangdMain.cpp
@@ -87,10 +87,10 @@
 llvm::cl::init(PCHStorageFlag::Disk));
 
 static llvm::cl::opt 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 RunSynchronously(
 "run-synchronously",
@@ -117,9 +117,9 @@
 static llvm::cl::opt 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 YamlSymbolFile(
 "yaml-symbol-file",
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits