module RubyLanguageServer::ScopeParserCommands::RakeCommands
Public Instance Methods
on_namespace_command(line, args, rest)
click to toggle source
# File lib/ruby_language_server/scope_parser_commands/rake_commands.rb, line 18 def on_namespace_command(line, args, rest) # OMG. Rake commands can have like any form. # The most reliable way I can see to name them is to grab the string # I *so* do not want to hear about it when it doesn't work. name = rest.flatten.detect { |o| o.instance_of?(String) } # add_scope(args, rest, ScopeData::Scope::TYPE_METHOD) 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
on_task_command(line, args, rest)
click to toggle source
# File lib/ruby_language_server/scope_parser_commands/rake_commands.rb, line 6 def on_task_command(line, args, rest) # OMG. Rake commands can have like any form. # The most reliable way I can see to name them is to grab the string # I *so* do not want to hear about it when it doesn't work. name = rest.flatten.detect { |o| o.instance_of?(String) } # add_scope(args, rest, ScopeData::Scope::TYPE_METHOD) 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