Skip to content

Commit 96225dc

Browse files
authored
Merge pull request #2588 from ruby/fix-locator
Fix locator
2 parents 0e6cacb + a8d21ad commit 96225dc

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/rbs/locator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def find_in_loc(pos, location:, array:)
238238

239239
def test_loc(pos, location:)
240240
if location
241-
location.range === pos
241+
location.start_pos <= pos && pos <= location.end_pos
242242
else
243243
false
244244
end

sig/locator.rbs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ module RBS
3737
#
3838
def find2: (line: Integer, column: Integer) -> [Symbol?, Array[component]]?
3939

40-
private
41-
4240
def find_in_directive: (Integer pos, AST::Directives::t, Array[component]) -> bool
4341

4442
def find_in_decl: (Integer pos, decl: AST::Declarations::t, array: Array[component]) -> bool

0 commit comments

Comments
 (0)