Class: RubyLsp::Mongoid::IndexingEnhancement

Inherits:
RubyIndexer::Enhancement
  • Object
show all
Defined in:
lib/ruby_lsp/ruby_lsp_mongoid/indexing_enhancement.rb

Instance Method Summary collapse

Constructor Details

#initialize(listener) ⇒ IndexingEnhancement

Returns a new instance of IndexingEnhancement.



6
7
8
# File 'lib/ruby_lsp/ruby_lsp_mongoid/indexing_enhancement.rb', line 6

def initialize(listener)
  super
end

Instance Method Details

#on_call_node_enter(call_node) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ruby_lsp/ruby_lsp_mongoid/indexing_enhancement.rb', line 10

def on_call_node_enter(call_node)
  owner = @listener.current_owner
  return unless owner

  case call_node.name
  when :include
    handle_include(call_node)
  when :field
    handle_field(call_node)
  when :embeds_many, :embedded_in
    handle_accessor_dsl(call_node)
  when :has_many, :has_and_belongs_to_many
    handle_many_association(call_node)
  when :has_one, :belongs_to, :embeds_one
    handle_singular_association(call_node)
  when :scope
    handle_scope(call_node)
  end
end

#on_call_node_leave(call_node) ⇒ Object



30
# File 'lib/ruby_lsp/ruby_lsp_mongoid/indexing_enhancement.rb', line 30

def on_call_node_leave(call_node); end