Skip to content

codeintel: fix range-contains off-by-one end character check

Administrator requested to merge nsc/codeintel-ranges-offbyone into main

Created by: Strum355

Fixes the below issue where hovering the following whitespace would give code intel results for the apiFlags variable. This also happens in situations such as Token) where hovering the ) would give the same behaviour. This is due to LSIF ranges specifying half-open intervals aka a range denoted by start-end chars as 2, 10 would be [2, 10): \t\tapiFlags 0 1 234567890

The ComparePosition function changed in this PR did not account for that final index not being part of the range.

image

Merge request reports

Loading