Skip to content

Commit

Permalink
Map special RPC paths
Browse files Browse the repository at this point in the history
Now `$/cancelRequest` will be resolved to `$server->cancelRequest()`
and `$/textDocument/whatever` to `$server->textDocument->whatever()`
  • Loading branch information
weirdan committed Jul 24, 2023
1 parent f2c77ca commit e1a30a2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Psalm/Internal/LanguageServer/LanguageServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -997,4 +997,19 @@ public static function uriToPath(string $uri): string

return $filepath;
}

// the methods below forward special paths
// like `$/cancelRequest` to `$this->cancelRequest()`
// and `$/a/b/c` to `$this->a->b->c()`

public function __isset(string $prop_name): bool
{
return $prop_name === '$';
}

/** @return static */
public function __get(string $prop_name): self

Check failure on line 1011 in src/Psalm/Internal/LanguageServer/LanguageServer.php

View workflow job for this annotation

GitHub Actions / build

PossiblyUnusedParam

src/Psalm/Internal/LanguageServer/LanguageServer.php:1011:34: PossiblyUnusedParam: Param #1 is never referenced in this method (see https://psalm.dev/134)
{
return $this;
}
}

0 comments on commit e1a30a2

Please sign in to comment.