Class: Rubocop::Language::Server::State

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/language/server/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, text:, diagnostics: []) ⇒ State

Returns a new instance of State.



7
8
9
10
11
# File 'lib/rubocop/language/server/state.rb', line 7

def initialize(uri:, text:, diagnostics: [])
  @uri = uri
  @text = text
  @diagnostics = diagnostics
end

Instance Attribute Details

#diagnosticsObject (readonly)

Returns the value of attribute diagnostics.



5
6
7
# File 'lib/rubocop/language/server/state.rb', line 5

def diagnostics
  @diagnostics
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/rubocop/language/server/state.rb', line 5

def text
  @text
end

#uriObject (readonly)

Returns the value of attribute uri.



5
6
7
# File 'lib/rubocop/language/server/state.rb', line 5

def uri
  @uri
end

Instance Method Details

#code_actions(line_range) ⇒ Object



13
14
15
# File 'lib/rubocop/language/server/state.rb', line 13

def code_actions(line_range)
  diagnostics.code_actions(line_range)
end