Skip to content

Commit

Permalink
Update tests to account for new progress protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Jul 26, 2023
1 parent 9f90633 commit ea9ffe0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/LanguageServer/DiagnosticTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,21 @@ public function testSnippetSupportDisabled(): void
);

$write->on('message', function (Message $message) use ($deferred, $server): void {
/** @psalm-suppress PossiblyNullPropertyFetch,UndefinedPropertyFetch,MixedPropertyFetch */
if ($message->body->method === 'telemetry/event' && $message->body->params->message === 'initialized') {
/** @psalm-suppress NullPropertyFetch,PossiblyNullPropertyFetch,UndefinedPropertyFetch */
if ($message->body->method === 'telemetry/event' && ($message->body->params->message ?? null) === 'initialized') {
$this->assertFalse($server->clientCapabilities->textDocument->completion->completionItem->snippetSupport);
$deferred->resolve(null);
return;
}

/** @psalm-suppress NullPropertyFetch,PossiblyNullPropertyFetch */
if ($message->body->method === '$/progress'
&& ($message->body->params->value->kind ?? null) === 'end'
&& ($message->body->params->value->message ?? null) === 'initialized'
) {
$this->assertFalse($server->clientCapabilities->textDocument->completion->completionItem->snippetSupport);
$deferred->resolve(null);
return;
}
});

Expand Down

0 comments on commit ea9ffe0

Please sign in to comment.