diff --git a/tests/Server/TextDocument/DocumentSymbolTest.php b/tests/Server/TextDocument/DocumentSymbolTest.php index 979e8ab..c0ea9c4 100644 --- a/tests/Server/TextDocument/DocumentSymbolTest.php +++ b/tests/Server/TextDocument/DocumentSymbolTest.php @@ -17,16 +17,16 @@ class DocumentSymbolTest extends TextDocumentTestCase $uri = pathToUri(realpath(__DIR__ . '/../../../fixtures/symbols.php')); $result = $this->textDocument->documentSymbol(new TextDocumentIdentifier($uri)); $this->assertEquals([ - new SymbolInformation('TEST_CONST', SymbolKind::CONSTANT, new Location($uri, new Range(new Position( 4, 6), new Position( 4, 22))), 'TestNamespace'), - new SymbolInformation('TestClass', SymbolKind::CLASS_, new Location($uri, new Range(new Position( 6, 0), new Position(21, 1))), 'TestNamespace'), - new SymbolInformation('TEST_CLASS_CONST', SymbolKind::CONSTANT, new Location($uri, new Range(new Position( 8, 10), new Position( 8, 32))), 'TestNamespace\\TestClass'), - new SymbolInformation('staticTestProperty', SymbolKind::FIELD, new Location($uri, new Range(new Position( 9, 18), new Position( 9, 37))), 'TestNamespace\\TestClass'), - new SymbolInformation('testProperty', SymbolKind::FIELD, new Location($uri, new Range(new Position(10, 11), new Position(10, 24))), 'TestNamespace\\TestClass'), - new SymbolInformation('staticTestMethod', SymbolKind::METHOD, new Location($uri, new Range(new Position(12, 4), new Position(15, 5))), 'TestNamespace\\TestClass'), - new SymbolInformation('testMethod', SymbolKind::METHOD, new Location($uri, new Range(new Position(17, 4), new Position(20, 5))), 'TestNamespace\\TestClass'), - new SymbolInformation('TestTrait', SymbolKind::CLASS_, new Location($uri, new Range(new Position(23, 0), new Position(26, 1))), 'TestNamespace'), - new SymbolInformation('TestInterface', SymbolKind::INTERFACE, new Location($uri, new Range(new Position(28, 0), new Position(31, 1))), 'TestNamespace'), - new SymbolInformation('test_function', SymbolKind::FUNCTION, new Location($uri, new Range(new Position(33, 0), new Position(36, 1))), 'TestNamespace') + new SymbolInformation('TEST_CONST', SymbolKind::CONSTANT, $this->getDefinitionLocation('TestNamespace\\TEST_CONST'), 'TestNamespace'), + new SymbolInformation('TestClass', SymbolKind::CLASS_, $this->getDefinitionLocation('TestNamespace\\TestClass'), 'TestNamespace'), + new SymbolInformation('TEST_CLASS_CONST', SymbolKind::CONSTANT, $this->getDefinitionLocation('TestNamespace\\TestClass::TEST_CLASS_CONST'), 'TestNamespace\\TestClass'), + new SymbolInformation('staticTestProperty', SymbolKind::FIELD, $this->getDefinitionLocation('TestNamespace\\TestClass::staticTestProperty'), 'TestNamespace\\TestClass'), + new SymbolInformation('testProperty', SymbolKind::FIELD, $this->getDefinitionLocation('TestNamespace\\TestClass::testProperty'), 'TestNamespace\\TestClass'), + new SymbolInformation('staticTestMethod', SymbolKind::METHOD, $this->getDefinitionLocation('TestNamespace\\TestClass::staticTestMethod()'), 'TestNamespace\\TestClass'), + new SymbolInformation('testMethod', SymbolKind::METHOD, $this->getDefinitionLocation('TestNamespace\\TestClass::testMethod()'), 'TestNamespace\\TestClass'), + new SymbolInformation('TestTrait', SymbolKind::CLASS_, $this->getDefinitionLocation('TestNamespace\\TestTrait'), 'TestNamespace'), + new SymbolInformation('TestInterface', SymbolKind::INTERFACE, $this->getDefinitionLocation('TestNamespace\\TestInterface'), 'TestNamespace'), + new SymbolInformation('test_function', SymbolKind::FUNCTION, $this->getDefinitionLocation('TestNamespace\\test_function()'), 'TestNamespace'), ], $result); } } diff --git a/tests/Server/TextDocument/TextDocumentTestCase.php b/tests/Server/TextDocument/TextDocumentTestCase.php index 1733fea..35004f9 100644 --- a/tests/Server/TextDocument/TextDocumentTestCase.php +++ b/tests/Server/TextDocument/TextDocumentTestCase.php @@ -58,6 +58,7 @@ abstract class TextDocumentTestCase extends TestCase // Global 'TEST_CONST' => new Location($globalSymbolsUri, new Range(new Position( 4, 6), new Position(4, 22))), 'TestClass' => new Location($globalSymbolsUri, new Range(new Position( 6, 0), new Position(21, 1))), + 'TestTrait' => new Location($globalSymbolsUri, new Range(new Position(23, 0), new Position(26, 1))), 'TestInterface' => new Location($globalSymbolsUri, new Range(new Position(28, 0), new Position(31, 1))), 'TestClass::TEST_CLASS_CONST' => new Location($globalSymbolsUri, new Range(new Position( 8, 10), new Position(8, 32))), 'TestClass::testProperty' => new Location($globalSymbolsUri, new Range(new Position(10, 11), new Position(10, 24))), @@ -70,6 +71,7 @@ abstract class TextDocumentTestCase extends TestCase 'TestNamespace\\TEST_CONST' => new Location($symbolsUri, new Range(new Position( 4, 6), new Position(4, 22))), 'TestNamespace\\TestClass' => new Location($symbolsUri, new Range(new Position( 6, 0), new Position(21, 1))), 'TestNamespace\\TestInterface' => new Location($symbolsUri, new Range(new Position(28, 0), new Position(31, 1))), + 'TestNamespace\\TestTrait' => new Location($symbolsUri, new Range(new Position(23, 0), new Position(26, 1))), 'TestNamespace\\TestClass::TEST_CLASS_CONST' => new Location($symbolsUri, new Range(new Position( 8, 10), new Position(8, 32))), 'TestNamespace\\TestClass::testProperty' => new Location($symbolsUri, new Range(new Position(10, 11), new Position(10, 24))), 'TestNamespace\\TestClass::staticTestProperty' => new Location($symbolsUri, new Range(new Position( 9, 18), new Position(9, 37))),