Commit d9d27e5
Filter code actions based on prefix, not equality (#2146)
It's quite unclear in the spec, but in
microsoft/language-server-protocol#970
it's suggested that the intention is that the kinds given in `only`
should be used as *prefix* filters of the generated code action kinds.
That is to say, if the client asks for `only = [ CodeActionRefactor ]`,
we should give them all kinds of refactoring code actions, including
those whose kind is `CodeActionRefactorInline` (because as "hierarchical
strings" they are represented as `"refactor"` and `"refactor.inline"`).
This is quite important for the client: e.g. I hit this because I wanted
to ask for all the import quickfixes so I could present them to the user
to pick one. But they use various subkinds of `"quickfix.import"`, so
currently you cannot ask for them all (asking for `"quickfix.import"`
currentl returns nothing!).
The ipmlemention is a little ugly: this needs some helper funcitons in
`lsp`, which I'll make a PR for separately, but I didn't want to block
this.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>1 parent 384902c commit d9d27e5
File tree
2 files changed
+20
-13
lines changed- hls-plugin-api/src/Ide
- test/functional
2 files changed
+20
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
196 | 205 | | |
197 | 206 | | |
198 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
| 530 | + | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
540 | 539 | | |
541 | 540 | | |
542 | 541 | | |
543 | | - | |
544 | | - | |
545 | 542 | | |
546 | | - | |
547 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
548 | 546 | | |
549 | 547 | | |
550 | 548 | | |
551 | 549 | | |
552 | 550 | | |
553 | 551 | | |
554 | | - | |
| 552 | + | |
555 | 553 | | |
556 | 554 | | |
557 | 555 | | |
| |||
0 commit comments