microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.03k stars 12.49k forks source link

Disable or remove specific code action/fixes/refactoring #37332

Open heroboy opened 4 years ago

heroboy commented 4 years ago

Search Terms

Suggestion

https://github.com/microsoft/vscode/issues/92305

Because when some code action is available, there will be a icon shows on the code editing area. If some fixes I always not want, it's annoying that the clickable icon will show every time my cursor move on the code or select some code or some other actions. Especially when the current line left is not white spaces, the icon will show at previous line and cover the privious line code.

For example, I always want use require in js file not import.

And maybe some visual effect like the dash underline, the show fixes button in the popup tip, the dimmed color text should be removed, when the relate code action is disabled. Because these hint there are problems in my code but actually not.

Use Cases

Examples

Checklist

My suggestion meets these guidelines:

RyanCavanaugh commented 4 years ago

@mjbvz is there any editor-side support for this?

mjbvz commented 4 years ago

We don't have a UI for managing suggestions/actions. For now, this would likely be provided using a setting that VS Code could pass to TS

I believe there are two parts to this request:

heroboy commented 4 years ago

like this

"editor.codeActionsOnSave": [
    "source.organizeImports",
    "source.fixAll"
]

what about:

"editor.codeActionsNotShow": [
    "source.organizeImports",
    "source.fixAll"
]
orassayag commented 3 years ago

I would like an option to remove this: Untitled

JakeJohnson05 commented 3 years ago

Is there any progress with this feature? I would like to remove SOME but not all VSCode suggestions.

PowerWeb5 commented 2 years ago

This would help avoid the auto deletion of unreachable code like occurs with Prettier + ESLint in VSCode, if could just disable that single code action, while still allowing other Prettier formatting to occur, like mentioned in https://github.com/microsoft/vscode/issues/109530.