mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Clean up more unused return values
This commit is contained in:
parent
8509999f3f
commit
a6d79fd409
@ -93,13 +93,10 @@ class ClientHandler
|
||||
*
|
||||
* @param string $method The method to call
|
||||
* @param array|object $params The method parameters
|
||||
*
|
||||
* @return Promise<void> Will be resolved as soon as the notification has been sent
|
||||
*/
|
||||
public function notify(string $method, $params): Promise
|
||||
public function notify(string $method, $params): void
|
||||
{
|
||||
/** @var Promise<void> */
|
||||
return $this->protocolWriter->write(
|
||||
$this->protocolWriter->write(
|
||||
new Message(
|
||||
new AdvancedJsonRpc\Notification($method, (object)$params)
|
||||
)
|
||||
|
@ -42,10 +42,8 @@ class LanguageClient
|
||||
* - 2 = Warning
|
||||
* - 3 = Info
|
||||
* - 4 = Log
|
||||
*
|
||||
* @return Promise<void>
|
||||
*/
|
||||
public function logMessage(string $message, int $type = 4, string $method = 'window/logMessage'): Promise
|
||||
public function logMessage(string $message, int $type = 4, string $method = 'window/logMessage'): void
|
||||
{
|
||||
// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#window_logMessage
|
||||
|
||||
@ -53,7 +51,7 @@ class LanguageClient
|
||||
$type = 4;
|
||||
}
|
||||
|
||||
return $this->handler->notify(
|
||||
$this->handler->notify(
|
||||
$method,
|
||||
[
|
||||
'type' => $type,
|
||||
|
@ -455,17 +455,17 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
|
||||
* @param string|null $additional_info This is additional info that the client
|
||||
* can use as part of the display message.
|
||||
*/
|
||||
private function clientStatus(string $status, ?string $additional_info = null): Promise
|
||||
private function clientStatus(string $status, ?string $additional_info = null): void
|
||||
{
|
||||
try {
|
||||
// here we send a notification to the client using the telemetry notification method
|
||||
return $this->client->logMessage(
|
||||
$this->client->logMessage(
|
||||
$status . (!empty($additional_info) ? ': ' . $additional_info : ''),
|
||||
3,
|
||||
'telemetry/event'
|
||||
);
|
||||
} catch (\Throwable $err) {
|
||||
return new Success(null);
|
||||
new Success(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user