1
0
Fork 0

Add Diagnostic source and severity

pull/357/head
Rob Lourens 2017-05-14 14:17:43 -07:00
parent de08134173
commit addc862404
1 changed files with 6 additions and 3 deletions

View File

@ -79,7 +79,10 @@ class TolerantTreeAnalyzer implements TreeAnalyzerInterface {
new Range(
new Position($range->start->line, $range->start->character),
new Position($range->end->line, $range->start->character)
)
),
null,
DiagnosticSeverity::ERROR,
'php'
);
}
}
@ -96,7 +99,7 @@ class TolerantTreeAnalyzer implements TreeAnalyzerInterface {
if (!(
(
// $node->parent instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression ||
($node instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression ||
($node instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression ||
$node instanceof Tolerant\Node\Expression\MemberAccessExpression)
&& !(
$node->parent instanceof Tolerant\Node\Expression\CallExpression ||
@ -143,7 +146,7 @@ class TolerantTreeAnalyzer implements TreeAnalyzerInterface {
}
$this->collectDefinitionsAndReferences($node);
}
public function getDiagnostics() {
return $this->diagnostics ?? [];
}