mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:42:11 +00:00
Issue 43152. Use existing LineInfo in newDiagnosticMessage().
R=brianwilkerson@google.com Bug: https://github.com/dart-lang/sdk/issues/43152 Change-Id: I1e88df0a5d2b1695b45ddfe22c84a354a9e33c4e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159741 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
e868d3076c
commit
675891ae0c
|
@ -152,16 +152,11 @@ DiagnosticMessage newDiagnosticMessage(
|
|||
var file = message.filePath;
|
||||
var offset = message.offset;
|
||||
var length = message.length;
|
||||
var startLine = -1;
|
||||
var startColumn = -1;
|
||||
var lineInfo = result.session.getFile(file).lineInfo;
|
||||
if (lineInfo != null) {
|
||||
CharacterLocation lineLocation = lineInfo.getLocation(offset);
|
||||
if (lineLocation != null) {
|
||||
startLine = lineLocation.lineNumber;
|
||||
startColumn = lineLocation.columnNumber;
|
||||
}
|
||||
}
|
||||
|
||||
var lineLocation = result.lineInfo.getLocation(offset);
|
||||
var startLine = lineLocation.lineNumber;
|
||||
var startColumn = lineLocation.columnNumber;
|
||||
|
||||
return DiagnosticMessage(
|
||||
message.message, Location(file, offset, length, startLine, startColumn));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue