-
Notifications
You must be signed in to change notification settings - Fork 660
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
[lsp] Report progress using $/progress
notifications
#10035
Comments
Hey @weirdan, can you reproduce the issue on https://psalm.dev ? |
/cc: @tm1000 |
@weirdan so I believe trying to get
So the VSCode client is sent to the server but I believe that isn't in the LSP spec it's just something VSCode does. If I (we, whomever) can figure out a way to get the You can assign this to me and I can look into the JSON rpc server and step through it using xdebug |
Doesn't it only happen for incoming requests though? |
The way mapping works it splits the request name using a separator (we use Unlike methods, property names can be arbitrary, so $this->{"$"} = new class($this) {
private object $parent;
public function __construct(object $parent)
{
$this->parent = $parent;
}
public function cancelRequest(mixed ...$args): mixed
{
return $this->parent->cancelRequest(...$args);
}
}; to forward the call to Alternatively, we could define |
Oh. Wow. I never knew that about Php!! |
On the other hand it won't work to detect the extension version, as it will likely contain something like Perhaps something like the following could work local reporting_type = 'progress'
if client.name == 'VSCode' then
reporting_type = 'telemetry'
if get_hidden_config_param('psalm-vscode.version') > '1.2.3' then
reporting_type = 'progress'
end
end |
@weirdan look at how the go LSP does it. It does it based on a client capability being checked. That's what the psalm LSP should do as well See: https://go.googlesource.com/tools/+/refs/tags/gopls/v0.5.0/internal/lsp/progress.go#35 |
So we would use Sounds good to me. |
Fixed in #10050 |
Currently, we're using ad-hoc solution to report progress to vscode extension, using telemetry events. This requires specific client-side support. There's now a better option: reporting the progress using
$/progress
notifications, that are allowed during the initialize phase if client sendsworkDoneToken
ininitialize
request. Using it would allow reporting the progress to any compliant client, not just our vscode ext.Spec links:
Open questions:
workDoneToken
in initialize requests (this can probably be overridden somewhere).The text was updated successfully, but these errors were encountered: