Skip to content

Commit

Permalink
fix: PluginException: Range must be inside element being annotated
Browse files Browse the repository at this point in the history
Fixes #1087

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr authored and fbricon committed Aug 11, 2023
1 parent 3d6405d commit 683e2e7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public static Range toRange(TextRange range, Document document) {
public static @Nullable TextRange toTextRange(Range range, Document document) {
final int start = LSPIJUtils.toOffset(range.getStart(), document);
final int end = LSPIJUtils.toOffset(range.getEnd(), document);
if (start >= end) {
if (start >= end || end > document.getTextLength()) {
// Language server reports invalid diagnostic, ignore it.
return null;
}
Expand Down

0 comments on commit 683e2e7

Please sign in to comment.