Merge 0e04ba90bd
into 3931c8848f
commit
89c817ddd1
|
@ -338,7 +338,7 @@ class TextDocument
|
||||||
}
|
}
|
||||||
$contents = [];
|
$contents = [];
|
||||||
if ($def->declarationLine) {
|
if ($def->declarationLine) {
|
||||||
$contents[] = new MarkedString('php', "<?php\n" . $def->declarationLine);
|
$contents[] = new MarkedString('php', $def->declarationLine);
|
||||||
}
|
}
|
||||||
if ($def->documentation) {
|
if ($def->documentation) {
|
||||||
$contents[] = $def->documentation;
|
$contents[] = $def->documentation;
|
||||||
|
|
|
@ -21,7 +21,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->start
|
$reference->range->start
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\nclass TestClass implements TestInterface"),
|
new MarkedString('php', "class TestClass implements TestInterface"),
|
||||||
'Pariatur ut laborum tempor voluptate consequat ea deserunt.' . "\n\n" .
|
'Pariatur ut laborum tempor voluptate consequat ea deserunt.' . "\n\n" .
|
||||||
'Deserunt enim minim sunt sint ea nisi. Deserunt excepteur tempor id nostrud' . "\n" .
|
'Deserunt enim minim sunt sint ea nisi. Deserunt excepteur tempor id nostrud' . "\n" .
|
||||||
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
|
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
|
||||||
|
@ -41,7 +41,7 @@ class HoverTest extends ServerTestCase
|
||||||
$definition->range->start
|
$definition->range->start
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\nclass TestClass implements TestInterface"),
|
new MarkedString('php', "class TestClass implements TestInterface"),
|
||||||
'Pariatur ut laborum tempor voluptate consequat ea deserunt.' . "\n\n" .
|
'Pariatur ut laborum tempor voluptate consequat ea deserunt.' . "\n\n" .
|
||||||
'Deserunt enim minim sunt sint ea nisi. Deserunt excepteur tempor id nostrud' . "\n" .
|
'Deserunt enim minim sunt sint ea nisi. Deserunt excepteur tempor id nostrud' . "\n" .
|
||||||
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
|
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
|
||||||
|
@ -61,7 +61,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\npublic function testMethod(\$testParameter): TestInterface"),
|
new MarkedString('php', "public function testMethod(\$testParameter): TestInterface"),
|
||||||
'Non culpa nostrud mollit esse sunt laboris in irure ullamco cupidatat amet.'
|
'Non culpa nostrud mollit esse sunt laboris in irure ullamco cupidatat amet.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\npublic \$testProperty;"),
|
new MarkedString('php', "public \$testProperty;"),
|
||||||
'Reprehenderit magna velit mollit ipsum do.'
|
'Reprehenderit magna velit mollit ipsum do.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\npublic static function staticTestMethod()"),
|
new MarkedString('php', "public static function staticTestMethod()"),
|
||||||
'Do magna consequat veniam minim proident eiusmod incididunt aute proident.'
|
'Do magna consequat veniam minim proident eiusmod incididunt aute proident.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\npublic static \$staticTestProperty;"),
|
new MarkedString('php', "public static \$staticTestProperty;"),
|
||||||
'Lorem excepteur officia sit anim velit veniam enim.'
|
'Lorem excepteur officia sit anim velit veniam enim.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\nconst TEST_CLASS_CONST = 123;"),
|
new MarkedString('php', "const TEST_CLASS_CONST = 123;"),
|
||||||
'Anim labore veniam consectetur laboris minim quis aute aute esse nulla ad.'
|
'Anim labore veniam consectetur laboris minim quis aute aute esse nulla ad.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\nfunction test_function()"),
|
new MarkedString('php', "function test_function()"),
|
||||||
'Officia aliquip adipisicing et nulla et laboris dolore labore.'
|
'Officia aliquip adipisicing et nulla et laboris dolore labore.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class HoverTest extends ServerTestCase
|
||||||
$reference->range->end
|
$reference->range->end
|
||||||
)->wait();
|
)->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\nconst TEST_CONST = 123;"),
|
new MarkedString('php', "const TEST_CONST = 123;"),
|
||||||
'Esse commodo excepteur pariatur Lorem est aute incididunt reprehenderit.'
|
'Esse commodo excepteur pariatur Lorem est aute incididunt reprehenderit.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ class HoverTest extends ServerTestCase
|
||||||
)->wait();
|
)->wait();
|
||||||
// TODO - should pretty print with fqns, like \define, \false. Not yet supported by tolerant-php-parser
|
// TODO - should pretty print with fqns, like \define, \false. Not yet supported by tolerant-php-parser
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\ndefine('TEST_DEFINE_CONSTANT', false)"),
|
new MarkedString('php', "define('TEST_DEFINE_CONSTANT', false)"),
|
||||||
'Lorem ipsum dolor sit amet, consectetur.'
|
'Lorem ipsum dolor sit amet, consectetur.'
|
||||||
], $reference->range), $result);
|
], $reference->range), $result);
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ class HoverTest extends ServerTestCase
|
||||||
$uri = pathToUri(realpath(__DIR__ . '/../../../fixtures/references.php'));
|
$uri = pathToUri(realpath(__DIR__ . '/../../../fixtures/references.php'));
|
||||||
$result = $this->textDocument->hover(new TextDocumentIdentifier($uri), new Position(13, 7))->wait();
|
$result = $this->textDocument->hover(new TextDocumentIdentifier($uri), new Position(13, 7))->wait();
|
||||||
$this->assertEquals(new Hover(
|
$this->assertEquals(new Hover(
|
||||||
[new MarkedString('php', "<?php\n\$var = 123")],
|
[new MarkedString('php', "\$var = 123")],
|
||||||
new Range(new Position(13, 5), new Position(13, 9))
|
new Range(new Position(13, 5), new Position(13, 9))
|
||||||
), $result);
|
), $result);
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ class HoverTest extends ServerTestCase
|
||||||
$result = $this->textDocument->hover(new TextDocumentIdentifier($uri), new Position(22, 11))->wait();
|
$result = $this->textDocument->hover(new TextDocumentIdentifier($uri), new Position(22, 11))->wait();
|
||||||
$this->assertEquals(new Hover(
|
$this->assertEquals(new Hover(
|
||||||
[
|
[
|
||||||
new MarkedString('php', "<?php\nTestClass \$param"),
|
new MarkedString('php', "TestClass \$param"),
|
||||||
'Adipisicing non non cillum sint incididunt cillum enim mollit.'
|
'Adipisicing non non cillum sint incididunt cillum enim mollit.'
|
||||||
],
|
],
|
||||||
new Range(new Position(22, 9), new Position(22, 15))
|
new Range(new Position(22, 9), new Position(22, 15))
|
||||||
|
@ -206,7 +206,7 @@ class HoverTest extends ServerTestCase
|
||||||
$uri = pathToUri(realpath(__DIR__ . '/../../../fixtures/global_symbols.php'));
|
$uri = pathToUri(realpath(__DIR__ . '/../../../fixtures/global_symbols.php'));
|
||||||
$result = $this->textDocument->hover(new TextDocumentIdentifier($uri), new Position(59, 11))->wait();
|
$result = $this->textDocument->hover(new TextDocumentIdentifier($uri), new Position(59, 11))->wait();
|
||||||
$this->assertEquals(new Hover([
|
$this->assertEquals(new Hover([
|
||||||
new MarkedString('php', "<?php\nclass TestClass implements TestInterface"),
|
new MarkedString('php', "class TestClass implements TestInterface"),
|
||||||
'Pariatur ut laborum tempor voluptate consequat ea deserunt.' . "\n\n" .
|
'Pariatur ut laborum tempor voluptate consequat ea deserunt.' . "\n\n" .
|
||||||
'Deserunt enim minim sunt sint ea nisi. Deserunt excepteur tempor id nostrud' . "\n" .
|
'Deserunt enim minim sunt sint ea nisi. Deserunt excepteur tempor id nostrud' . "\n" .
|
||||||
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
|
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
|
||||||
|
|
Loading…
Reference in New Issue