feat: Support ranges for errors and warnings #1669
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: stylelint/vscode-stylelint#315, stylelint/stylelint#5694
Allows for better diagnostics in linters, language servers, and plugins.
Currently, since only single positions are supported, this means that downstream, when we display errors in different tools, in my particular case, a language server and editor integration, we can only display a single position as part of the error, even when the error pertains to more than just one character.
These changes allow warnings and errors to be emitted with an additional
endLineandendColumnwhich pertains to an end position, exclusive, of the problem. It also adjusts CSS syntax errors to always provide an end position for consistency. With these additions, we would be able to better highlight problems in Stylelint and other tools and use that information in integrations for a better developer experience.rangeByadded, which provides a range for a given word or start and end indices