Clang: Properly apply fix-its from header files

Diagnostic may also include fix-its for the header
which require different handling.

Task-number: QTCREATORBUG-20517
Change-Id: I3e745622801be3fa2856d968b0c7a2a2aeb89b50
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-06-27 15:29:14 +02:00
parent fcfa98ab7c
commit e99d09f846
3 changed files with 31 additions and 24 deletions

View File

@@ -119,13 +119,14 @@ public:
const Debugger::DiagnosticLocation start = step.ranges.first();
const Debugger::DiagnosticLocation end = step.ranges.last();
const int startPos = file.position(start.line, start.column);
const int endPos = file.position(end.line, end.column);
const int startPos = file.position(start.filePath, start.line, start.column);
const int endPos = file.position(start.filePath, end.line, end.column);
auto op = new ReplacementOperation;
op->pos = startPos;
op->length = endPos - startPos;
op->text = step.message;
op->fileName = start.filePath;
op->apply = apply;
replacements += op;