Conversation
types/src/main.ts
Outdated
| * Actions not of this kind are filtered out by the client before being shown. So servers | ||
| * can omit computing them. | ||
| */ | ||
| only?: CodeActionKind |
There was a problem hiding this comment.
Why isn't this a CodeActionKind[] so that the client can request two separate kinds of code actions? What if I don't want quickfix but I want both refactor and source?
|
Good point. Agree to change this. |
| VCodeActionKind.RefactorInline.value!, | ||
| VCodeActionKind.RefactorRewrite.value!, | ||
| VCodeActionKind.Source.value!, | ||
| VCodeActionKind.SourceOrganizeImports.value! |
There was a problem hiding this comment.
Wouldn't it make more sense to use CodeActionKind from the language server protocol instead of using the VS Code one? That sounds a lot safer and is more agnostic since then we're only using stuff that the protocol explicitly declares.
| /** | ||
| * A set of predefined code action kinds | ||
| */ | ||
| export namespace CodeActionKind { |
There was a problem hiding this comment.
There is no Empty type but VS Code does have one. Is this intentional?
There was a problem hiding this comment.
I though that this is not necessary in the LSP since we can simply use the empty string. In VSCode it is a class with a private constructor hence you can only make new kinds by starting with Empty and then append. Since we have literals I felt this is overkill and left it out.
| cap.codeActionLiteralSupport = { | ||
| codeActionKind: { | ||
| valueSet: [ | ||
| VCodeActionKind.Empty.value!, |
There was a problem hiding this comment.
The protocol doesn't have a CodeActionKind.Empty declared. Is this an issue? See below.
No description provided.