Allow ignoring certain TS suggestion-level diagnostic codes
See original GitHub issueRelated to what was discussed in https://github.com/Microsoft/vscode/issues/61326. Would provide more granularity to the settings introduced with https://github.com/Microsoft/vscode/pull/46590.
It might be useful to introduce a new setting to ignore certain suggestion diagnostic codes while still keeping suggestion diagnostics enabled, rather than having to disable them altogether.
What I’m proposing is to introduce 2 new settings, javascript.suggestionActions.ignoredCodes
and typescript.suggestionActions.ignoredCodes
. These would take a list of suggestion diagnostic codes that the user wants to ignore, given as a string of either comma- or space-separated code numbers.
Example:
{
// ...
"typescript.suggestionActions.enabled": true,
"typescript.suggestionActions.ignoredCodes": "7043, 80006"
// ...
}
This list would only be checked when a suggestion-level diagnostic is received, so including non-suggestion-level diagnostic codes in the list would have no effect (errors and messages would not be ignored).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:72
- Comments:9 (3 by maintainers)
Top GitHub Comments
Is there any progress with this feature? I would like to remove some VSCode suggestions. I would like an option to remove this:
@mjbvz That’s actually a better idea, adding those settings as compiler options instead.
The
diagnostics
setting could be extended to not only support a boolean, but to also accept an object withinclude
andexclude
arrays of codes. These 2 should be mutually exclusive, I don’t see any situation where it would make sense to have both.So for example, instead of fully disabling diagnostics as it can be done now, the user could do the following to enable all diagnostics except for some of them:
Or, similarly, only enable some of the diagnostics:
If it’s decided to go that way, it might be worth assigning string identifiers to the diagnostic codes. Something like this would be much more readable: