Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/prism/node_find.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module NodeFind # :nodoc:
# Find the node for the given callable or backtrace location.
#--
#: (Method | UnboundMethod | Proc | Thread::Backtrace::Location callable, bool rubyvm) -> Node?
#++
def self.find(callable, rubyvm)
case callable
when Proc
Expand Down Expand Up @@ -50,7 +49,6 @@ class Find
# Parse the given file path, returning a ParseResult or nil.
#--
#: (String? file) -> ParseResult?

def parse_file(file)
return unless file && File.readable?(file)
result = Prism.parse_file(file)
Expand All @@ -64,7 +62,6 @@ class RubyVMCallableFind < Find
# Find the node for the given callable using the ISeq node_id.
#--
#: (Method | UnboundMethod | Proc callable) -> Node?

def find(callable)
return unless (source_location = callable.source_location)
return unless (result = parse_file(source_location[0]))
Expand All @@ -83,7 +80,6 @@ class RubyVMBacktraceLocationFind < Find
# Find the node for the given backtrace location using node_id.
#--
#: (Thread::Backtrace::Location location) -> Node?

def find(location)
file = location.absolute_path || location.path
return unless (result = parse_file(file))
Expand All @@ -101,7 +97,6 @@ class LineMethodFind < Find
# Find the node for the given method by matching on name and line.
#--
#: (Method | UnboundMethod callable) -> Node?

def find(callable)
return unless (source_location = callable.source_location)
return unless (result = parse_file(source_location[0]))
Expand All @@ -128,7 +123,6 @@ class LineLambdaFind < Find
# Find the node for the given lambda by matching on line.
#--
#: (Proc callable) -> Node?

def find(callable)
return unless (source_location = callable.source_location)
return unless (result = parse_file(source_location[0]))
Expand All @@ -154,7 +148,6 @@ class LineProcFind < Find
# Find the node for the given proc by matching on line.
#--
#: (Proc callable) -> Node?

def find(callable)
return unless (source_location = callable.source_location)
return unless (result = parse_file(source_location[0]))
Expand All @@ -180,7 +173,6 @@ class LineBacktraceLocationFind < Find
# Find the node for the given backtrace location by matching on line.
#--
#: (Thread::Backtrace::Location location) -> Node?

def find(location)
file = location.absolute_path || location.path
return unless (result = parse_file(file))
Expand Down
7 changes: 7 additions & 0 deletions rbi/generated/prism/node_find.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions sig/generated/prism/node_find.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.