Class: RubyLsp::Ree::ParsedRspecDocument
Constant Summary
Constants included
from ReeLspUtils
ReeLspUtils::Entry
Instance Attribute Summary collapse
#ast, #link_nodes, #package_name
Instance Method Summary
collapse
#camelize, #find_local_file_path, #get_range_for_fn_insert, #get_ree_type, #get_uri_path, #package_name_from_spec_uri, #package_name_from_uri, #package_path_from_uri, #parameter_name, #path_from_package_folder, #signature_params_from_node, #spec_relative_file_path_from_uri, #underscore
#find_import_for_package, #find_link_by_usage_name, #find_link_node, #has_root_class?, #includes_dao_dsl?, #includes_link_dsl?, #includes_linked_object?, #includes_mapper_dsl?, #includes_ree_dsl?, #includes_routes_dsl?, #node_name, #set_package_name
Constructor Details
#initialize(ast, package_name = nil) ⇒ ParsedRspecDocument
Returns a new instance of ParsedRspecDocument.
11
12
13
14
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 11
def initialize(ast, package_name = nil)
super
parse_describe_node
end
|
Instance Attribute Details
#describe_node ⇒ Object
Returns the value of attribute describe_node.
9
10
11
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 9
def describe_node
@describe_node
end
|
Instance Method Details
#allows_root_links? ⇒ Boolean
16
17
18
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 16
def allows_root_links?
true
end
|
#has_blank_links_container? ⇒ Boolean
31
32
33
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 31
def has_blank_links_container?
false
end
|
#links_container_node ⇒ Object
20
21
22
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 20
def links_container_node
nil
end
|
#parse_describe_node ⇒ Object
35
36
37
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 35
def parse_describe_node
@describe_node ||= @ast.statements.body.detect{ |node| node.is_a?(Prism::CallNode) && node.name == :describe }
end
|
#parse_links ⇒ Object
39
40
41
42
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 39
def parse_links
container = @describe_node.block.body.body
@link_nodes = RubyLsp::Ree::LinksParser.new(container, package_name).parse_links
end
|
#root_node_line_location ⇒ Object
24
25
26
27
28
29
|
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/parsed_rspec_document.rb', line 24
def root_node_line_location
OpenStruct.new(
start_line: @describe_node.location.start_line,
end_column: @describe_node.block.opening_loc.end_column
)
end
|