forked from qt-creator/qt-creator
Clang: Honor fixits own locations in ClangFixItOperation
The fixits have own ranges/locations and thus might address more than one file. Change-Id: I5ee59944bef588e763a91f054a60823593373a0e Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -109,16 +109,13 @@ ClangFixItOperationsExtractor::extract(const QString &filePath, int line)
|
||||
}
|
||||
|
||||
void ClangFixItOperationsExtractor::appendFixitOperation(
|
||||
const QString &filePath,
|
||||
const QString &diagnosticText,
|
||||
const QVector<ClangBackEnd::FixItContainer> &fixits)
|
||||
{
|
||||
if (!fixits.isEmpty()) {
|
||||
const QString diagnosticTextTweaked = tweakedDiagnosticText(diagnosticText);
|
||||
TextEditor::QuickFixOperation::Ptr operation(
|
||||
new ClangFixItOperation(filePath,
|
||||
diagnosticTextTweaked,
|
||||
fixits));
|
||||
new ClangFixItOperation(diagnosticTextTweaked, fixits));
|
||||
operations.append(operation);
|
||||
}
|
||||
}
|
||||
@@ -130,7 +127,7 @@ void ClangFixItOperationsExtractor::extractFromDiagnostic(
|
||||
{
|
||||
const QVector<ClangBackEnd::FixItContainer> fixIts = diagnosticContainer.fixIts();
|
||||
if (hasFixItAt(fixIts, filePath, line)) {
|
||||
appendFixitOperation(filePath, diagnosticContainer.text().toString(), fixIts);
|
||||
appendFixitOperation(diagnosticContainer.text().toString(), fixIts);
|
||||
|
||||
foreach (const auto &child, diagnosticContainer.children())
|
||||
extractFromDiagnostic(child, filePath, line);
|
||||
|
||||
Reference in New Issue
Block a user