Begin to include end location where applicable #917
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.
This PR attempts to establish end location as an optional attribute of location data returned in violations, and updates ~10 rules in the bugs category to use this convention.
If no end location is provided, the default is as it used to be — end location will be set to the end of the line. For some rules, this is the right thing to do anyway, and therefore, not all rules will need to be updated..
That obviously doesn't "fix" #654, but it's a start, and as far as I've seen so far, works quite well. Importantly this change is non-breaking method for API users! Ideally, we'd put the current "row" and "col" into a "start" object too, but that would be a breaking change, and one that would impact all API users, so let's consider that for our first stable release instead.
NOTE that this does not change anything in the output of
regal lint
using the default "pretty"-reporter, but is only included in the more detailed JSON and SARIF formats. First and foremost this change helps LSP clients display diagnostics more accurately, and that is really where this is most useful.When this has been merged, I'll create some new issues to get this backported to each of the rule categories.