[ty] Implement workspace/didChangeConfiguration#24712
[ty] Implement workspace/didChangeConfiguration#24712pierrem964 wants to merge 11 commits intoastral-sh:mainfrom
workspace/didChangeConfiguration#24712Conversation
| }, | ||
| ); | ||
|
|
||
| Ok(()) |
There was a problem hiding this comment.
We should call publish_diagnostics_if_needed here for clients using the push diagnostics model.
There was a problem hiding this comment.
Do we need to updates tests to cover this?
| fn run( | ||
| session: &mut Session, | ||
| client: &Client, | ||
| _params: types::DidChangeConfigurationParams, |
There was a problem hiding this comment.
The params do contain the changed setting. Do you know if it includes all settings or do clients indeed only send the changed settings?
There was a problem hiding this comment.
On neovim, the invocation of this notification is manual, so you need to pass the settings as an argument through client:notify.
Had a go trying to see what vscode send with the didChangeConfiguration event, it seems like nothing is sent at all.
It seems this varies from client to client. Let me know if I've misunderstood this comment :)
There was a problem hiding this comment.
Testing it with VS Code would be good. Specifically also to test whether it sends the notification is only sent when changing ty specific settings or is sent when changing arbitrary VS Code settings.
It would be so nice if it included the whole configuration. It feels silly that we have to request the configuration again :( I'd rather avoid that
There was a problem hiding this comment.
I removed all the selected items from:
Running ty with this PRs compiled executable I get the following behavior:
Changing a ty setting (diagnostic mode), I get the log:
[Trace - 6:23:48 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
"settings": null
}
Changing a non-ty, vscode setting (Auto Save), I also get the log:
[Trace - 6:24:46 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
"settings": null
}
Unfortunately I don't think it includes the config =(, at least with vscode it seems necessary to repull everything.
0d5366f to
7ed12ec
Compare
Summary
Implements astral-sh/ty#953
Adds a notification handler for
workspace/didConfigurationChange. Re initializesworkspaceswhen this is received with the newly pulled settings.Workspaces are just reinitialized with a new settings passed from the client.
Copied code from #20545, so credit to @Guillaume-Fgt for that.
Test Plan
I've added a unit test in configuration making sure this runs successfully. I am unsure if this is sufficient so please let me know how I can improve the testing implemented in this PR.
Manually tested on vscode via the extension and neovim