Author: Christian Kandeler
Date: 2022-10-22T10:17:41+02:00
New Revision: 6ed4a543b8b3ab38ddb30cf4c15b70ed11266388

URL: 
https://github.com/llvm/llvm-project/commit/6ed4a543b8b3ab38ddb30cf4c15b70ed11266388
DIFF: 
https://github.com/llvm/llvm-project/commit/6ed4a543b8b3ab38ddb30cf4c15b70ed11266388.diff

LOG: [clangd] Make file limit for textDocument/rename configurable

Without this, clients are unable to rename often-used symbols in larger
projects.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D136454

Added: 
    

Modified: 
    clang-tools-extra/clangd/tool/ClangdMain.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 68c0a51a2d74d..53b6653c51f20 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -327,6 +327,14 @@ opt<int> ReferencesLimit{
     init(1000),
 };
 
+opt<int> RenameFileLimit{
+    "rename-file-limit",
+    cat(Features),
+    desc("Limit the number of files to be affected by symbol renaming. "
+         "0 means no limit (default=50)"),
+    init(50),
+};
+
 list<std::string> TweakList{
     "tweaks",
     cat(Features),
@@ -891,6 +899,7 @@ clangd accepts flags on the commandline, and in the 
CLANGD_FLAGS environment var
   Opts.BackgroundIndex = EnableBackgroundIndex;
   Opts.BackgroundIndexPriority = BackgroundIndexPriority;
   Opts.ReferencesLimit = ReferencesLimit;
+  Opts.Rename.LimitFiles = RenameFileLimit;
   auto PAI = createProjectAwareIndex(loadExternalIndex, Sync);
   if (StaticIdx) {
     IdxStack.emplace_back(std::move(StaticIdx));


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

Reply via email to