Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix end position of diagnostic for LSP
Follow up rubocop/rubocop#12932. This is a porting because it can be said that even Standard.rb, which serves as the base for RuboCop's built-in LSP, does the same thing. --- This is a quote from rubocop/rubocop#12932. `character` of `Position` is zero-based https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position > Character offset on a line in a document (zero-based). And, `Parser::Source::Range` is also zero-based https://github.com/whitequark/parser/blob/3e260d2e37bcb3de8705489d1c2799c26c7a2215/lib/parser/source/range.rb#L104 > zero-based column number of the end of this range. Therefore, `-1` is not necessary.
- Loading branch information