1
0
Fork 0

Better calculation of endLine

pull/62/head
Kaloyan Raev 2016-10-10 21:18:20 +03:00
parent 888d20384b
commit 66255b1f5b
1 changed files with 1 additions and 1 deletions

View File

@ -178,7 +178,7 @@ class PhpDocument
$diagnostic = new Diagnostic();
$startLine = max($error->getStartLine() - 1, 0);
$startColumn = $error->hasColumnInfo() ? $error->getStartColumn($this->content) - 1 : 0;
$endLine = $error->getEndLine() === -1 ? $startLine : $error->getEndLine() - 1;
$endLine = max($error->getEndLine() - 1, $startLine);
$endColumn = $error->hasColumnInfo() ? $error->getEndColumn($this->content) : 0;
$diagnostic->range = new Range(new Position($startLine, $startColumn), new Position($endLine, $endColumn));
$diagnostic->severity = DiagnosticSeverity::ERROR;