vscode: Display diagnostic error codes
Would it be possible for the diagnostic error code to be surfaced to the user in some way?
Diagnostics as defined in the LSP and vscode-api have a code
field which is not easily visible to the user in vscode. Language servers/compilers often allow the suppression of specific diagnostics by passing a list of error codes to ignore. Currently, as far as I know, extensions have to intercept LSP diagnostics and hardbake the code into error message, or incorrectly use the source
field.
E.g: Both of these solutions are less than ideal, as they mean that the raw “Copy” data is incorrect, and inconsistent across extensions.
It seems odd that source
, a field that is generally obvious from context, is displayed, but there is no proper support for the code
field.
I’m not sure what the best way of actually displaying it would be, but a few things come to mind:
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 21 (15 by maintainers)
Commits related to this issue
- Implement #49215 — committed to microsoft/vscode by sandy081 6 years ago
Please bring back the name in the hover. If I need to disable a rule that’s where I get the name from.
Now I’m stuck googling the error message or linting the whole project from the command line to get the name 🤦♂️
Before line numbers
@tboby
Starting from
vscode-eslint@1.6.1
, the easiest way to get eslint’s rule id is to open the Problems window.cc @cdeutsch @drKnoxy