Closed fsommar closed 1 month ago
BTW why the left part of Either is not checked?
BTW why the left part of Either is not checked?
I think it's fair to assume that the resolve provider is false if no options are being passed; either codeAction is enabled with a boolean for the most basic support, or options are provided where additional functionality like codeAction.resolve can be enabled.
Specification https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionOptions
But it can be disabled with the boolean as well
But it can be disabled with the boolean as well
I'll use examples to illustrate how I'm thinking:
{
"codeAction": true
}
{
"codeAction": {
"resolveProvider": true
}
}
{
"codeAction": {
"resolveProvider": false
}
}
{
"codeAction": {}
}
{
"codeAction": false
}
{}
# | codeAction | codeAction.resolve |
---|---|---|
1 | true | false |
2 | true | true |
3 | true | false |
4 | true | false |
5 | false | false |
6 | false | false |
If you're referring to 5.
, it will be false for codeAction.resolve since provider != null && provider.isRight()
will be false.
Oh, sorry, I missed that this method is about codeActionResolve and not codeAction itself. Yes, you are right and everything is correct
The resolveProvider field doesn't need to be present even if the codeAction param is.
From the specification: