parent
3856f4f46a
commit
5d2ab8f369
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
$abc = 1;
|
||||
$abc2 = 2;
|
||||
echo $ab
|
|
@ -57,7 +57,7 @@ class LanguageServerTest extends TestCase
|
|||
if ($msg->body->method === 'window/logMessage' && $promise->state === Promise::PENDING) {
|
||||
if ($msg->body->params->type === MessageType::ERROR) {
|
||||
$promise->reject(new Exception($msg->body->params->message));
|
||||
} else if (strpos($msg->body->params->message, 'All 25 PHP files parsed') !== false) {
|
||||
} else if (strpos($msg->body->params->message, 'All 26 PHP files parsed') !== false) {
|
||||
$promise->fulfill();
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ class LanguageServerTest extends TestCase
|
|||
if ($promise->state === Promise::PENDING) {
|
||||
$promise->reject(new Exception($msg->body->params->message));
|
||||
}
|
||||
} else if (strpos($msg->body->params->message, 'All 25 PHP files parsed') !== false) {
|
||||
} else if (strpos($msg->body->params->message, 'All 26 PHP files parsed') !== false) {
|
||||
$promise->fulfill();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -433,4 +433,36 @@ class CompletionTest extends TestCase
|
|||
)
|
||||
], true), $items);
|
||||
}
|
||||
|
||||
public function testBarePhp()
|
||||
{
|
||||
$completionUri = pathToUri(__DIR__ . '/../../../fixtures/completion/bare_php.php');
|
||||
$this->loader->open($completionUri, file_get_contents($completionUri));
|
||||
$items = $this->textDocument->completion(
|
||||
new TextDocumentIdentifier($completionUri),
|
||||
new Position(4, 8)
|
||||
)->wait();
|
||||
$this->assertEquals(new CompletionList([
|
||||
new CompletionItem(
|
||||
'$abc2',
|
||||
CompletionItemKind::VARIABLE,
|
||||
'int',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
new TextEdit(new Range(new Position(4, 8), new Position(4, 8)), 'c2')
|
||||
),
|
||||
new CompletionItem(
|
||||
'$abc',
|
||||
CompletionItemKind::VARIABLE,
|
||||
'int',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
new TextEdit(new Range(new Position(4, 8), new Position(4, 8)), 'c')
|
||||
)
|
||||
], true), $items);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue