Check if node has parent
parent
a1ae0f6e48
commit
bc5717ab79
|
@ -127,8 +127,11 @@ class CompletionProvider
|
||||||
$node = $doc->getNodeAtPosition($pos);
|
$node = $doc->getNodeAtPosition($pos);
|
||||||
|
|
||||||
$offset = $node === null ? -1 : $pos->toOffset($node->getFileContents());
|
$offset = $node === null ? -1 : $pos->toOffset($node->getFileContents());
|
||||||
if ($node !== null && $offset > $node->getEndPosition() &&
|
if (
|
||||||
$node->parent->getLastChild() instanceof PhpParser\MissingToken
|
$node !== null
|
||||||
|
&& $offset > $node->getEndPosition()
|
||||||
|
&& $node->parent !== null
|
||||||
|
&& $node->parent->getLastChild() instanceof PhpParser\MissingToken
|
||||||
) {
|
) {
|
||||||
$node = $node->parent;
|
$node = $node->parent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue