forked from qt-creator/qt-creator
ClangCodeModel: Re-enable renaming via clangd
The hard rename limit is gone, see https://reviews.llvm.org/D136454. Make the feature opt-in for now, as we still need to do some UI fine- tuning Change-Id: Ic631a5b39711c6f37fffeeec4d2a5f5bf3bde92b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -162,6 +162,8 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP
|
|||||||
cmd.addArg("--background-index-priority="
|
cmd.addArg("--background-index-priority="
|
||||||
+ ClangdSettings::priorityToString(indexingPriority));
|
+ ClangdSettings::priorityToString(indexingPriority));
|
||||||
}
|
}
|
||||||
|
if (settings.clangdVersion() >= QVersionNumber(16))
|
||||||
|
cmd.addArg("--rename-file-limit=0");
|
||||||
if (!jsonDbDir.isEmpty())
|
if (!jsonDbDir.isEmpty())
|
||||||
cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString());
|
cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString());
|
||||||
if (clangdLogServer().isDebugEnabled())
|
if (clangdLogServer().isDebugEnabled())
|
||||||
@@ -470,13 +472,13 @@ void ClangdClient::findUsages(TextDocument *document, const QTextCursor &cursor,
|
|||||||
if (searchTerm.isEmpty())
|
if (searchTerm.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Fix hard file limit in clangd, then uncomment this with version check.
|
// Will fix QTCREATORBUG-27978 and QTCREATORBUG-28109 once enabled by default.
|
||||||
// Will fix QTCREATORBUG-27978 and QTCREATORBUG-28109.
|
if (replacement && versionNumber() >= QVersionNumber(16)
|
||||||
// if (replacement) {
|
&& Utils::qtcEnvironmentVariableIsSet("QTC_CLANGD_RENAMING")) {
|
||||||
// symbolSupport().renameSymbol(document, adjustedCursor, *replacement,
|
symbolSupport().renameSymbol(document, adjustedCursor, *replacement,
|
||||||
// CppEditor::preferLowerCaseFileNames());
|
CppEditor::preferLowerCaseFileNames());
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
const bool categorize = CppEditor::codeModelSettings()->categorizeFindReferences();
|
const bool categorize = CppEditor::codeModelSettings()->categorizeFindReferences();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user