Skip to content

Commit

Permalink
Provice fallback when mid_code_range method not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
riseshia committed Apr 29, 2024
1 parent 4449ce0 commit d16c57c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/typeprof/core/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ 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.mid_code_range]
code_range = mdef.node.respond_to?(:mid_code_range) ? mdef.node.mid_code_range : mdef.node.code_range
defs << [mdef.node.lenv.path, code_range]
end
end
end
Expand Down

0 comments on commit d16c57c

Please sign in to comment.