Skip to content

Commit

Permalink
Fixes vimeo#5997 by intentionally sending Success response from shutd…
Browse files Browse the repository at this point in the history
…own method
  • Loading branch information
tm1000 committed Jun 28, 2021
1 parent 8c13752 commit 2e05377
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Psalm/Internal/LanguageServer/LanguageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ function (IssueData $issue_data) : Diagnostic {
* The shutdown request is sent from the client to the server. It asks the server to shut down,
* but to not exit (otherwise the response might not be delivered correctly to the client).
* There is a separate exit notification that asks the server to exit.
* @psalm-suppress PossiblyUnusedReturnValue
*/
public function shutdown(): void
public function shutdown(): Promise
{
$this->clientStatus('closing');
$this->verboseLog("Shutting down...");
Expand All @@ -407,7 +408,7 @@ public function shutdown(): void
$scanned_files
);
$this->clientStatus('closed');
new Success(null);
return new Success(null);
}

/**
Expand Down Expand Up @@ -439,7 +440,6 @@ private function verboseLog(string $message, int $type = 4): void
'[Psalm ' .PSALM_VERSION. ' - PHP Language Server] ' . $message,
$type
);
return;
} catch (\Throwable $err) {
// do nothing
}
Expand All @@ -465,8 +465,9 @@ private function clientStatus(string $status, ?string $additional_info = null):
'telemetry/event'
);
} catch (\Throwable $err) {
new Success(null);
// do nothing
}
new Success(null);
}

/**
Expand Down

0 comments on commit 2e05377

Please sign in to comment.