Ability to hide warnings in Language Server#7379
Conversation
|
|
Yeah @orklah v5 is fine. Should I scope it to that? |
|
yeah, if version is not an issue, please target master branch |
|
@orklah is there an issue for what the roadmap of v5 is? |
|
There's a discussion here: #7171 but there is no clear roadmap defined. |
|
@orklah ok thanks. That actually helps a lot. I think I can slip in a few more features into v5 or maybe at least upgrade amp to whatever version supported 7.4 if it's not already up to date here |
|
I'm putting this in draft for now while you change target |
Doesn't look like one to me. From what I understand, older clients would ignore the configuration request (or return an error). What makes you think it's a break? |
|
It changes the params in a public function here: https://github.com/vimeo/psalm/pull/7379/files#diff-2102b4f3a518a68952841a4b0e556c2d104fdf35072a295ec2738dad61d0cc0dR225 |
|
The class is internal though, so we can change it any way we want. |
|
There aren't any breaking changes because the parameters are dynamic. It's how the language server is written. Any params sent over STDIN (from the language server) are then send to methods/classes using reflection. Because reflection is used it can never really break as long as you set sane parameter defaults. The ordering of parameters could also be swapped because the alignment is determined by reflection as to where the values go to each parameter I realize this is confusing but it's how Felix Becker wrote the language server which is centered around AMPPHP. Once you get your head around it it starts making sense in a way. but if I apply this to v5 then I can just move more configuration settings into this for IDEs so that we don't have to restart psalm every time. So I'm fine with shooting for more work on the language server in v5 |
|
if there's no BC break, I'm fine with both :) |
|
Should new features be in v5 moving forward? I'm quite fascinated by what Matt was able to achieve using php and creating a language server out of Psalm and I think there's a lot of way to go as long as you both keep approving my PRs ;) (additionally Matt/Weirden gave me admin on the psalm vscode plug-in as well) |
For now, features can target either. Once v5 is released we will close v4 for new features. |
|
See: https://github.com/tm1000/psalm/tree/feature/upgrade-lsp Which will make it's way in here once I get unit tests added |
|
Superseded by #8960 |
As it is currently warnings (eg if you have level set to 4 then levels 1-3 will be warnings in your IDE) are shown in IDEs utilizing language server. Users have requested the ability to disable that (psalm/psalm-vscode-plugin#16)
This PR adds the ability to hideWarnings but it also follows the Language Server Protocol to ask the client what the current configuration is. This allows this setting to be changed without having to restart Psalm Language Server (which you have to do for all other settings because they are CLI flags). https://microsoft.github.io/language-server-protocol/specification#workspace_configuration