vscode-yaml
vscode-yaml copied to clipboard
Add capability to ignore schema errors
Is your enhancement related to a problem? Please describe.
When using certain yaml files with underlying schemas, there are times where a syntax error is shown that the user would like to ignore. The syntax error may be a false positive and not a true problem, but still shows as an error in VSCode. Currently, there is no way to workaround this other than to disable the schema on the entire file using a blank schema (please correct me if I'm wrong here).
The syntax errors are presented as red underlines in the file. Also, the "problematic" yaml file is highlighted red and shows the syntax error count next to it. This is frustrating because this is valid syntax and I know it is not an error, so I would like to ignore it. This is shown in the screenshot below:
Describe the solution you would like
I would like to be able to ignore specific schema errors with an inline comment. For example, if I put a comment on the line, the language server recognizes it and ignores the specific schema error on that line. An example would be like the screenshot below:
If the # ignore comment is found, the red underline would go away and there would be no error here.
Describe alternatives you have considered
Other alternatives:
A yaml. settings entry in VSCode settings file that would include a specific string matcher that ignore schema errors. For example, something like this:
{
"yaml.schemaStore.ignore": [
"!reference"
]
}
Additional Context
While this problem could be addressed by the maintainers of a specific schema, that is usually a slow process. Adding this feature would empower users to ignore syntax issues that don't apply to them and move faster.
Thanks for your consideration!
This seems like the same as https://github.com/redhat-developer/vscode-yaml/issues/666, I'd like to see this feature as well!