module RubyLanguageServer::ScopeParserCommands::RspecCommands

Public Instance Methods

on_context_command(line, args, rest) click to toggle source
# File lib/ruby_language_server/scope_parser_commands/rspec_commands.rb, line 10
def on_context_command(line, args, rest)
  rspec_block_command('context', line, args, rest)
end
on_describe_command(line, args, rest) click to toggle source
# File lib/ruby_language_server/scope_parser_commands/rspec_commands.rb, line 6
def on_describe_command(line, args, rest)
  rspec_block_command('describe', line, args, rest)
end
on_it_command(line, args, rest) click to toggle source
# File lib/ruby_language_server/scope_parser_commands/rspec_commands.rb, line 14
def on_it_command(line, args, rest)
  rspec_block_command('it', line, args, rest)
end

Private Instance Methods

rspec_block_command(prefix, line, args, rest) click to toggle source
# File lib/ruby_language_server/scope_parser_commands/rspec_commands.rb, line 20
def rspec_block_command(prefix, line, args, rest)
  name = "#{prefix} "
  name += rest.flatten.select { |part| part.instance_of?(String) }.join('::')
  push_scope(ScopeData::Scope::TYPE_MODULE, name, line, 0, false)
  process(args)
  process(rest)
  # We push a scope and don't pop it because we're called inside on_method_add_block
end