From f28690cea595389c1b349916504df62f782f6819 Mon Sep 17 00:00:00 2001 From: Kaloyan Raev Date: Wed, 14 Sep 2016 00:26:48 +0300 Subject: [PATCH] Fixes #27: Shift end position in SymbolInformation ranges --- src/SymbolFinder.php | 2 +- tests/Server/TextDocumentTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SymbolFinder.php b/src/SymbolFinder.php index 6db3a47d..087cadd6 100644 --- a/src/SymbolFinder.php +++ b/src/SymbolFinder.php @@ -69,7 +69,7 @@ public function enterNode(Node $node) $this->uri, new Range( new Position($node->getAttribute('startLine') - 1, $node->getAttribute('startColumn') - 1), - new Position($node->getAttribute('endLine') - 1, $node->getAttribute('endColumn') - 1) + new Position($node->getAttribute('endLine') - 1, $node->getAttribute('endColumn')) ) ); $symbol->containerName = $this->containerName; diff --git a/tests/Server/TextDocumentTest.php b/tests/Server/TextDocumentTest.php index 697a2bdb..ec9c3a35 100644 --- a/tests/Server/TextDocumentTest.php +++ b/tests/Server/TextDocumentTest.php @@ -36,7 +36,7 @@ public function testDocumentSymbol() ], 'end' => [ 'line' => 2, - 'character' => 23 + 'character' => 24 ] ] ], @@ -54,7 +54,7 @@ public function testDocumentSymbol() ], 'end' => [ 'line' => 12, - 'character' => 0 + 'character' => 1 ] ] ], @@ -72,7 +72,7 @@ public function testDocumentSymbol() ], 'end' => [ 'line' => 6, - 'character' => 23 + 'character' => 24 ] ] ], @@ -90,7 +90,7 @@ public function testDocumentSymbol() ], 'end' => [ 'line' => 11, - 'character' => 4 + 'character' => 5 ] ] ], @@ -108,7 +108,7 @@ public function testDocumentSymbol() ], 'end' => [ 'line' => 17, - 'character' => 0 + 'character' => 1 ] ] ], @@ -126,7 +126,7 @@ public function testDocumentSymbol() ], 'end' => [ 'line' => 22, - 'character' => 0 + 'character' => 1 ] ] ],