Exception: Spoom::LSP::Error::Diagnostics

Inherits:
Spoom::LSP::Error show all
Defined in:
lib/spoom/sorbet/lsp/errors.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, diagnostics) ⇒ Diagnostics

Returns a new instance of Diagnostics.


20
21
22
23
# File 'lib/spoom/sorbet/lsp/errors.rb', line 20

def initialize(uri, diagnostics)
  @uri = uri
  @diagnostics = diagnostics
end

Instance Attribute Details

#diagnosticsObject (readonly)

Returns the value of attribute diagnostics.


11
12
13
# File 'lib/spoom/sorbet/lsp/errors.rb', line 11

def diagnostics
  @diagnostics
end

#uriObject (readonly)

Returns the value of attribute uri.


11
12
13
# File 'lib/spoom/sorbet/lsp/errors.rb', line 11

def uri
  @uri
end

Class Method Details

.from_json(json) ⇒ Object


13
14
15
16
17
18
# File 'lib/spoom/sorbet/lsp/errors.rb', line 13

def self.from_json(json)
  Diagnostics.new(
    json['uri'],
    json['diagnostics'].map { |d| Diagnostic.from_json(d) }
  )
end