Class: RubyLsp::Ree::BasicParser
- Inherits:
-
Object
- Object
- RubyLsp::Ree::BasicParser
show all
- Defined in:
- lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/basic_parser.rb
Instance Method Summary
collapse
Instance Method Details
#get_method_body(node) ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/basic_parser.rb', line 10
def get_method_body(node)
return unless node.body
if node.body.is_a?(Prism::BeginNode)
node.body.statements.body
else
node.body.body
end
end
|
#node_name(node) ⇒ Object
4
5
6
7
8
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/basic_parser.rb', line 4
def node_name(node)
return nil unless node.respond_to?(:name)
node.name
end
|