Skip to content

Commit

Permalink
Drop unused parameters for RPC methods
Browse files Browse the repository at this point in the history
Parameters are marshalled using their names and docblock tags, so it's safe to do.
  • Loading branch information
weirdan committed Jul 26, 2023
1 parent c2a05c2 commit a34222a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/Psalm/Internal/LanguageServer/LanguageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,31 +378,19 @@ public static function run(
* The initialize request is sent as the first request from the client to the server.
*
* @param ClientCapabilities $capabilities The capabilities provided by the client (editor)
* @param int|null $processId The process Id of the parent process that started the server.
* Is null if the process has not been started by another process. If the parent process is
* not alive then the server should exit (see exit notification) its process.
* @param ClientInfo|null $clientInfo Information about the client
* @param string|null $locale The locale the client is currently showing the user interface
* in. This must not necessarily be the locale of the operating
* system.
* @param string|null $rootPath The rootPath of the workspace. Is null if no folder is open.
* @param mixed $initializationOptions
* @param string|null $trace The initial trace setting. If omitted trace is disabled ('off').
* @param string|null $workDoneToken The token to be used to report progress during init.
* @psalm-return Promise<InitializeResult>
* @psalm-suppress PossiblyUnusedParam
*/
public function initialize(
ClientCapabilities $capabilities,
?int $processId = null,
?ClientInfo $clientInfo = null,
?string $locale = null,
?string $rootPath = null,
?string $rootUri = null,
$initializationOptions = null,
?string $trace = null,
?string $workDoneToken = null
//?array $workspaceFolders = null //error in json-dispatcher
): Promise {
$this->clientInfo = $clientInfo;
$this->clientCapabilities = $capabilities;
Expand Down
4 changes: 1 addition & 3 deletions src/Psalm/Internal/LanguageServer/Server/TextDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,8 @@ public function signatureHelp(TextDocumentIdentifier $textDocument, Position $po
* The code action request is sent from the client to the server to compute commands
* for a given text document and range. These commands are typically code fixes to
* either fix problems or to beautify/refactor code.
*
* @psalm-suppress PossiblyUnusedParam
*/
public function codeAction(TextDocumentIdentifier $textDocument, Range $range, CodeActionContext $context): Promise
public function codeAction(TextDocumentIdentifier $textDocument, CodeActionContext $context): Promise
{
if (!$this->server->client->clientConfiguration->provideCodeActions) {
return new Success(null);
Expand Down
5 changes: 2 additions & 3 deletions src/Psalm/Internal/LanguageServer/Server/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ public function didChangeWatchedFiles(array $changes): void
/**
* A notification sent from the client to the server to signal the change of configuration settings.
*
* @param mixed $settings
* @psalm-suppress PossiblyUnusedMethod, PossiblyUnusedParam
* @psalm-suppress PossiblyUnusedMethod
*/
public function didChangeConfiguration($settings): void
public function didChangeConfiguration(): void
{
$this->server->logDebug(
'workspace/didChangeConfiguration',
Expand Down

0 comments on commit a34222a

Please sign in to comment.