Skip to content

Commit

Permalink
Let service definitions return code ranges scoped to name
Browse files Browse the repository at this point in the history
Let jump to method name, not def keyword from method call go Def
  • Loading branch information
riseshia committed Apr 29, 2024
1 parent 520638a commit 0c9c59b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/typeprof/core/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def definitions(path, pos)
site.resolve(genv, nil) do |me, _ty, _mid, _orig_ty|
next unless me
me.defs.each do |mdef|
defs << [mdef.node.lenv.path, mdef.node.code_range]
defs << [mdef.node.lenv.path, mdef.node.mid_code_range]
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions scenario/service/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def foo(n)
test.rb:(1,0)-(7,3)

## definition: test.rb:9:5
test.rb:(2,2)-(3,5)
test.rb:(2,6)-(2,16)

## definition: test.rb:9:12
test.rb:(5,2)-(6,5)
test.rb:(5,6)-(5,9)

0 comments on commit 0c9c59b

Please sign in to comment.