From addc8624043aef9ee802ebbe09d852ed94d1fb64 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Sun, 14 May 2017 14:17:43 -0700 Subject: [PATCH] Add Diagnostic source and severity --- src/TolerantTreeAnalyzer.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/TolerantTreeAnalyzer.php b/src/TolerantTreeAnalyzer.php index 933b793..1b5bd0d 100644 --- a/src/TolerantTreeAnalyzer.php +++ b/src/TolerantTreeAnalyzer.php @@ -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 ?? []; }