diff --git a/src/ParserHelpers.php b/src/ParserHelpers.php index 81195a6..779c283 100644 --- a/src/ParserHelpers.php +++ b/src/ParserHelpers.php @@ -15,7 +15,6 @@ class ParserHelpers ( $node instanceof Node\QualifiedName && ( -// $node->parent instanceof Node\Statement\ExpressionStatement || $parent instanceof Node\Expression || $parent instanceof Node\DelimitedList\ExpressionList || $parent instanceof Node\ArrayElement || diff --git a/src/ParserKind.php b/src/ParserKind.php deleted file mode 100644 index 39d7559..0000000 --- a/src/ParserKind.php +++ /dev/null @@ -1,11 +0,0 @@ -getStart(), $node->getWidth(), $node->getFileContents()); diff --git a/src/Protocol/SymbolInformation.php b/src/Protocol/SymbolInformation.php index e0283d5..f3defbf 100644 --- a/src/Protocol/SymbolInformation.php +++ b/src/Protocol/SymbolInformation.php @@ -107,18 +107,6 @@ class SymbolInformation $symbol->name = $node->variableName->getText($node); } else if (!isset($symbol->name)) { return null; - // if (!isset($symbol->name)) { - // if ($node instanceof Node\Name) { - // $symbol->name = (string)$node; - // } else if ($node instanceof Node\Expr\Assign || $node instanceof Node\Expr\AssignOp) { - // $symbol->name = $node->var->name; - // } else if ($node instanceof Node\Expr\ClosureUse) { - // $symbol->name = $node->var; - // } else if (isset($node->name)) { - // $symbol->name = (string)$node->name; - // } else { - // return null; - // } } $symbol->location = Location::fromNode($node); diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index d00ebfa..c07586c 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -49,7 +49,7 @@ class TextDocument /** * @var ReadableIndex */ - public $index; + protected $index; /** * @var \stdClass|null diff --git a/src/TreeAnalyzer.php b/src/TreeAnalyzer.php index 1caa421..995f7c0 100644 --- a/src/TreeAnalyzer.php +++ b/src/TreeAnalyzer.php @@ -17,8 +17,10 @@ class TreeAnalyzer /** @var Node */ private $stmts; + /** @var Diagnostic[] */ private $diagnostics; + /** @var string */ private $content; /** @@ -65,11 +67,11 @@ class TreeAnalyzer $this->update($node); } - if (($_error = PhpParser\DiagnosticsProvider::checkDiagnostics($node)) !== null) { - $range = PhpParser\PositionUtilities::getRangeFromPosition($_error->start, $_error->length, $this->content); + if (($error = PhpParser\DiagnosticsProvider::checkDiagnostics($node)) !== null) { + $range = PhpParser\PositionUtilities::getRangeFromPosition($error->start, $error->length, $this->content); $this->diagnostics[] = new Diagnostic( - $_error->message, + $error->message, new Range( new Position($range->start->line, $range->start->character), new Position($range->end->line, $range->start->character)