Module: RubyLanguageServer::ScopeParserCommands::RubyCommands
- Included in:
- RubyLanguageServer::SEXPProcessor
- Defined in:
- lib/ruby_language_server/scope_parser_commands/ruby_commands.rb
Instance Method Summary collapse
- #on_attr_accessor_command(line, args, rest) ⇒ Object
-
#on_attr_command(line, args, rest) ⇒ Object
when ‘define_method’, ‘alias_method’, ‘public_class_method’, ‘private_class_method’, # “public”, “protected”, “private”, /^attr_(accessor|reader|writer)$/ # on_method_add_arg([:fcall, name], args) when ‘attr’ # [[:args_add_block, [[:symbol_literal, [:symbol, [:@ident, “top”, [3, 14]]]]], false]] ((_, ((_, (_, (_, name, (line, column))))))) = rest add_ivar(“@#name”, line, column) push_scope(ScopeData::Scope::TYPE_METHOD, name, line, column) pop_scope push_scope(ScopeData::Scope::TYPE_METHOD, “#name=”, line, column) pop_scope.
- #on_attr_reader_command(line, args, rest) ⇒ Object
- #on_attr_writer_command(line, args, rest) ⇒ Object
Instance Method Details
#on_attr_accessor_command(line, args, rest) ⇒ Object
26 27 28 29 30 |
# File 'lib/ruby_language_server/scope_parser_commands/ruby_commands.rb', line 26 def on_attr_accessor_command(line, args, rest) column = ruby_command_column(args) names = ruby_command_names(rest) ruby_command_add_attr(line, column, names, true, true) end |
#on_attr_command(line, args, rest) ⇒ Object
when ‘define_method’, ‘alias_method’,
'public_class_method', 'private_class_method',
# "public", "protected", "private",
/^attr_(accessor|reader|writer)$/
# on_method_add_arg([:fcall, name], args[0])
when ‘attr’
# [[:args_add_block, [[:symbol_literal, [:symbol, [:@ident, "top", [3, 14]]]]], false]]
((_, ((_, (_, (_, name, (line, column))))))) = rest
add_ivar("@#{name}", line, column)
push_scope(ScopeData::Scope::TYPE_METHOD, name, line, column)
pop_scope
push_scope(ScopeData::Scope::TYPE_METHOD, "#{name}=", line, column)
pop_scope
20 21 22 23 24 |
# File 'lib/ruby_language_server/scope_parser_commands/ruby_commands.rb', line 20 def on_attr_command(line, args, rest) column = ruby_command_column(args) names = ruby_command_names(rest) ruby_command_add_attr(line, column, names, true, true) end |
#on_attr_reader_command(line, args, rest) ⇒ Object
32 33 34 35 36 |
# File 'lib/ruby_language_server/scope_parser_commands/ruby_commands.rb', line 32 def on_attr_reader_command(line, args, rest) column = ruby_command_column(args) names = ruby_command_names(rest) ruby_command_add_attr(line, column, names, true, false) end |
#on_attr_writer_command(line, args, rest) ⇒ Object
38 39 40 41 42 |
# File 'lib/ruby_language_server/scope_parser_commands/ruby_commands.rb', line 38 def on_attr_writer_command(line, args, rest) column = ruby_command_column(args) names = ruby_command_names(rest) ruby_command_add_attr(line, column, names, false, true) end |