[PATCH] D101902: [clangd] Split CC and refs limit and increase refs limit to 1000

2021-05-05 Thread Kirill Bobyrev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe623ce6188d6: [clangd] Split CC and refs limit and increase 
refs limit to 1000 (authored by kbobyrev).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101902/new/

https://reviews.llvm.org/D101902

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


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -292,6 +292,14 @@
 init(100),
 };
 
+opt ReferencesLimit{
+"limit-references",
+cat(Features),
+desc("Limit the number of references returned by clangd. "
+ "0 means no limit (default=1000)"),
+init(1000),
+};
+
 list TweakList{
 "tweaks",
 cat(Features),
@@ -821,6 +829,7 @@
   }
 #endif
   Opts.BackgroundIndex = EnableBackgroundIndex;
+  Opts.ReferencesLimit = ReferencesLimit;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
 IdxStack.emplace_back(std::move(StaticIdx));
Index: clang-tools-extra/clangd/ClangdLSPServer.h
===
--- clang-tools-extra/clangd/ClangdLSPServer.h
+++ clang-tools-extra/clangd/ClangdLSPServer.h
@@ -65,6 +65,9 @@
 
 /// Enable preview of InlayHints feature.
 bool InlayHints = false;
+
+/// Limit the number of references returned (0 means no limit).
+size_t ReferencesLimit = 0;
   };
 
   ClangdLSPServer(Transport , const ThreadsafeFS ,
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1264,7 +1264,7 @@
 void ClangdLSPServer::onReference(const ReferenceParams ,
   Callback> Reply) {
   Server->findReferences(
-  Params.textDocument.uri.file(), Params.position, Opts.CodeComplete.Limit,
+  Params.textDocument.uri.file(), Params.position, Opts.ReferencesLimit,
   [Reply = std::move(Reply),
IncludeDecl(Params.context.includeDeclaration)](
   llvm::Expected Refs) mutable {


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -292,6 +292,14 @@
 init(100),
 };
 
+opt ReferencesLimit{
+"limit-references",
+cat(Features),
+desc("Limit the number of references returned by clangd. "
+ "0 means no limit (default=1000)"),
+init(1000),
+};
+
 list TweakList{
 "tweaks",
 cat(Features),
@@ -821,6 +829,7 @@
   }
 #endif
   Opts.BackgroundIndex = EnableBackgroundIndex;
+  Opts.ReferencesLimit = ReferencesLimit;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
 IdxStack.emplace_back(std::move(StaticIdx));
Index: clang-tools-extra/clangd/ClangdLSPServer.h
===
--- clang-tools-extra/clangd/ClangdLSPServer.h
+++ clang-tools-extra/clangd/ClangdLSPServer.h
@@ -65,6 +65,9 @@
 
 /// Enable preview of InlayHints feature.
 bool InlayHints = false;
+
+/// Limit the number of references returned (0 means no limit).
+size_t ReferencesLimit = 0;
   };
 
   ClangdLSPServer(Transport , const ThreadsafeFS ,
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1264,7 +1264,7 @@
 void ClangdLSPServer::onReference(const ReferenceParams ,
   Callback> Reply) {
   Server->findReferences(
-  Params.textDocument.uri.file(), Params.position, Opts.CodeComplete.Limit,
+  Params.textDocument.uri.file(), Params.position, Opts.ReferencesLimit,
   [Reply = std::move(Reply),
IncludeDecl(Params.context.includeDeclaration)](
   llvm::Expected Refs) mutable {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D101902: [clangd] Split CC and refs limit and increase refs limit to 1000

2021-05-05 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 343196.
kbobyrev marked an inline comment as done.
kbobyrev added a comment.

s/LimitReferences/ReferencesLimit/g


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101902/new/

https://reviews.llvm.org/D101902

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


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -292,6 +292,14 @@
 init(100),
 };
 
+opt ReferencesLimit{
+"limit-references",
+cat(Features),
+desc("Limit the number of references returned by clangd. "
+ "0 means no limit (default=1000)"),
+init(1000),
+};
+
 list TweakList{
 "tweaks",
 cat(Features),
@@ -821,6 +829,7 @@
   }
 #endif
   Opts.BackgroundIndex = EnableBackgroundIndex;
+  Opts.ReferencesLimit = ReferencesLimit;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
 IdxStack.emplace_back(std::move(StaticIdx));
Index: clang-tools-extra/clangd/ClangdLSPServer.h
===
--- clang-tools-extra/clangd/ClangdLSPServer.h
+++ clang-tools-extra/clangd/ClangdLSPServer.h
@@ -65,6 +65,9 @@
 
 /// Enable preview of InlayHints feature.
 bool InlayHints = false;
+
+/// Limit the number of references returned (0 means no limit).
+size_t ReferencesLimit = 0;
   };
 
   ClangdLSPServer(Transport , const ThreadsafeFS ,
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1264,7 +1264,7 @@
 void ClangdLSPServer::onReference(const ReferenceParams ,
   Callback> Reply) {
   Server->findReferences(
-  Params.textDocument.uri.file(), Params.position, Opts.CodeComplete.Limit,
+  Params.textDocument.uri.file(), Params.position, Opts.ReferencesLimit,
   [Reply = std::move(Reply),
IncludeDecl(Params.context.includeDeclaration)](
   llvm::Expected Refs) mutable {


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -292,6 +292,14 @@
 init(100),
 };
 
+opt ReferencesLimit{
+"limit-references",
+cat(Features),
+desc("Limit the number of references returned by clangd. "
+ "0 means no limit (default=1000)"),
+init(1000),
+};
+
 list TweakList{
 "tweaks",
 cat(Features),
@@ -821,6 +829,7 @@
   }
 #endif
   Opts.BackgroundIndex = EnableBackgroundIndex;
+  Opts.ReferencesLimit = ReferencesLimit;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
 IdxStack.emplace_back(std::move(StaticIdx));
Index: clang-tools-extra/clangd/ClangdLSPServer.h
===
--- clang-tools-extra/clangd/ClangdLSPServer.h
+++ clang-tools-extra/clangd/ClangdLSPServer.h
@@ -65,6 +65,9 @@
 
 /// Enable preview of InlayHints feature.
 bool InlayHints = false;
+
+/// Limit the number of references returned (0 means no limit).
+size_t ReferencesLimit = 0;
   };
 
   ClangdLSPServer(Transport , const ThreadsafeFS ,
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1264,7 +1264,7 @@
 void ClangdLSPServer::onReference(const ReferenceParams ,
   Callback> Reply) {
   Server->findReferences(
-  Params.textDocument.uri.file(), Params.position, Opts.CodeComplete.Limit,
+  Params.textDocument.uri.file(), Params.position, Opts.ReferencesLimit,
   [Reply = std::move(Reply),
IncludeDecl(Params.context.includeDeclaration)](
   llvm::Expected Refs) mutable {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D101902: [clangd] Split CC and refs limit and increase refs limit to 1000

2021-05-05 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks, lgtm!




Comment at: clang-tools-extra/clangd/ClangdLSPServer.h:70
+/// Limit the number of references returned (0 means no limit).
+size_t LimitReferences = 0;
   };

`s/LimitReferences/ReferencesLimit/` to be consistent with `CodeComplete.Limit` 
?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101902/new/

https://reviews.llvm.org/D101902

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


[PATCH] D101902: [clangd] Split CC and refs limit and increase refs limit to 1000

2021-05-05 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev created this revision.
kbobyrev added reviewers: kadircet, nridge.
Herald added subscribers: usaxena95, arphaman.
kbobyrev requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Related discussion: https://github.com/clangd/clangd/discussions/761


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101902

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


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -292,6 +292,14 @@
 init(100),
 };
 
+opt LimitReferences{
+"limit-references",
+cat(Features),
+desc("Limit the number of references returned by clangd. "
+ "0 means no limit (default=1000)"),
+init(1000),
+};
+
 list TweakList{
 "tweaks",
 cat(Features),
@@ -821,6 +829,7 @@
   }
 #endif
   Opts.BackgroundIndex = EnableBackgroundIndex;
+  Opts.LimitReferences = LimitReferences;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
 IdxStack.emplace_back(std::move(StaticIdx));
Index: clang-tools-extra/clangd/ClangdLSPServer.h
===
--- clang-tools-extra/clangd/ClangdLSPServer.h
+++ clang-tools-extra/clangd/ClangdLSPServer.h
@@ -65,6 +65,9 @@
 
 /// Enable preview of InlayHints feature.
 bool InlayHints = false;
+
+/// Limit the number of references returned (0 means no limit).
+size_t LimitReferences = 0;
   };
 
   ClangdLSPServer(Transport , const ThreadsafeFS ,
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1264,7 +1264,7 @@
 void ClangdLSPServer::onReference(const ReferenceParams ,
   Callback> Reply) {
   Server->findReferences(
-  Params.textDocument.uri.file(), Params.position, Opts.CodeComplete.Limit,
+  Params.textDocument.uri.file(), Params.position, Opts.LimitReferences,
   [Reply = std::move(Reply),
IncludeDecl(Params.context.includeDeclaration)](
   llvm::Expected Refs) mutable {


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -292,6 +292,14 @@
 init(100),
 };
 
+opt LimitReferences{
+"limit-references",
+cat(Features),
+desc("Limit the number of references returned by clangd. "
+ "0 means no limit (default=1000)"),
+init(1000),
+};
+
 list TweakList{
 "tweaks",
 cat(Features),
@@ -821,6 +829,7 @@
   }
 #endif
   Opts.BackgroundIndex = EnableBackgroundIndex;
+  Opts.LimitReferences = LimitReferences;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
 IdxStack.emplace_back(std::move(StaticIdx));
Index: clang-tools-extra/clangd/ClangdLSPServer.h
===
--- clang-tools-extra/clangd/ClangdLSPServer.h
+++ clang-tools-extra/clangd/ClangdLSPServer.h
@@ -65,6 +65,9 @@
 
 /// Enable preview of InlayHints feature.
 bool InlayHints = false;
+
+/// Limit the number of references returned (0 means no limit).
+size_t LimitReferences = 0;
   };
 
   ClangdLSPServer(Transport , const ThreadsafeFS ,
Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1264,7 +1264,7 @@
 void ClangdLSPServer::onReference(const ReferenceParams ,
   Callback> Reply) {
   Server->findReferences(
-  Params.textDocument.uri.file(), Params.position, Opts.CodeComplete.Limit,
+  Params.textDocument.uri.file(), Params.position, Opts.LimitReferences,
   [Reply = std::move(Reply),
IncludeDecl(Params.context.includeDeclaration)](
   llvm::Expected Refs) mutable {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits