Support more TypeScript LSP code actions
Is your feature request related to a problem? Please describe.
When using the Deno LSP vs the TypeScript LSP, I noticed that some code actions from the TypeScript LSP are not working with Deno:
{
"deno.enable": true,
"deno.lint": true,
"editor.defaultFormatter": "denoland.vscode-deno",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.ts": "explicit",
"source.removeUnused.ts": "explicit", // doesn't work
"source.addMissingImports.ts": "explicit", // doesn't work
"source.organizeImports.ts": "explicit"
}
}
Describe the solution you'd like
Feature parity with Typescript LSP would be great. 👍
I haven't tried these code actions "on save," but I use them quite a bit while editing. If the text cursor is in just the right place (after a symbol that isn't imported, or after an unused import symbol), you will (often, but not always!) be given these code actions as options when you press Command-Period.
@jgoux have you managed to get source.fixAll working? It doesn't work when I test it.
Here's minimal repro:
.vscode/settings.json
{
"deno.enable": true,
"deno.lint": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always"
}
}
deno.json
{
"lint": {
"rules": {
"include": ["verbatim-module-syntax"]
}
}
}
type.ts
export type Type = unknown;
test.ts
import { Type } from "./type.ts";
let type: Type;
When I save test.ts
Expected outcome: import { Type } from "./type.ts"; gets changed to import type { Type } from "./type.ts";
Actual outcome: nothing changes