ClangCodeModel: Limit result count in clangd-based locator searches

clangd memory usage explodes when the workspace/symbol result count hits
the six-digit mark, so prevent that.

Change-Id: Iefc2eeb3da7fe541e2b1d3105818126980fc3323
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-07-12 16:52:56 +02:00
parent d0172f80b4
commit 3c1e787215
4 changed files with 12 additions and 0 deletions

View File

@@ -43,6 +43,8 @@
namespace ClangCodeModel {
namespace Internal {
const int MaxResultCount = 10000;
class CppLocatorFilter : public CppTools::CppLocatorFilter
{
public:
@@ -67,6 +69,7 @@ public:
setDefaultShortcutString({});
setEnabled(false);
setHidden(true);
setMaxResultCount(MaxResultCount);
}
};
@@ -94,6 +97,7 @@ public:
setDefaultShortcutString({});
setEnabled(false);
setHidden(true);
setMaxResultCount(MaxResultCount);
}
};
@@ -121,6 +125,7 @@ public:
setDefaultShortcutString({});
setEnabled(false);
setHidden(true);
setMaxResultCount(MaxResultCount);
}
};