Uh oh!
There was an error while loading. Please reload this page.
Conversation
62280d2 to
b73f9e0CompareTake a method, unbound method, proc, or thread backtrace location. This is our equivalent to RubyVM::AbstractSyntaxTree.of, and could be leveraged in something like error highlight. Note that this uses CRuby-specific APIs on CRuby, and falls back to using location-based APIs when those aren't available.
eregon
commented
Mar 20, 2026
Nice. One potential gotcha of using |
| # matching by source location line number. | ||
| #-- | ||
| #: (Method | UnboundMethod | Proc | Thread::Backtrace::Location callable, ?rubyvm: bool) -> Node? | ||
| def self.find(callable, rubyvm: !!defined?(RubyVM)) |
There was a problem hiding this comment.
Is it intentional to expose a rubyvm: kwarg as public API here?
If it's just for testing, tests could use NodeFind.find directly.
Take a method, unbound method, proc, or thread backtrace location. This is our equivalent to RubyVM::AbstractSyntaxTree.of, and could be leveraged in something like error highlight.
Note that this uses CRuby-specific APIs on CRuby, and falls back to using location-based APIs when those aren't available.
Closes#3808.