Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #5997 by intentionally sending Success responses from methods #6006

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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