Class: State

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of State.



6
7
8
9
10
# File 'lib/rubocop/lsp/state.rb', line 6

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

Instance Attribute Details

#diagnosticsObject (readonly)

Returns the value of attribute diagnostics.



4
5
6
# File 'lib/rubocop/lsp/state.rb', line 4

def diagnostics
  @diagnostics
end

#textObject (readonly)

Returns the value of attribute text.



4
5
6
# File 'lib/rubocop/lsp/state.rb', line 4

def text
  @text
end

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/rubocop/lsp/state.rb', line 4

def uri
  @uri
end

Instance Method Details

#code_actions(line_range) ⇒ Object



12
13
14
# File 'lib/rubocop/lsp/state.rb', line 12

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