Sha256: 499229eaec72f5badcaa5c5f3554e460efceea21b2b33c83c7c7b38c5fd508c4

Contents?: true

Size: 923 Bytes

Versions: 15

Compression:

Stored size: 923 Bytes

Contents

# typed: true
# frozen_string_literal: true

module Spoom
  module LSP
    class Error < StandardError
      class AlreadyOpen < Error; end
      class BadHeaders < Error; end

      class Diagnostics < Error
        attr_reader :uri, :diagnostics

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

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

    class ResponseError < Error
      attr_reader :code, :message, :data

      def self.from_json(json)
        ResponseError.new(
          json['code'],
          json['message'],
          json['data']
        )
      end

      def initialize(code, message, data)
        @code = code
        @message = message
        @data = data
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spoom-1.1.8 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.7 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.6 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.5 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.4 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.3 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.2 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.1 lib/spoom/sorbet/lsp/errors.rb
spoom-1.1.0 lib/spoom/sorbet/lsp/errors.rb
spoom-1.0.9 lib/spoom/sorbet/lsp/errors.rb
spoom-1.0.8 lib/spoom/sorbet/lsp/errors.rb
spoom-1.0.7 lib/spoom/sorbet/lsp/errors.rb
spoom-1.0.6 lib/spoom/sorbet/lsp/errors.rb
spoom-1.0.5 lib/spoom/sorbet/lsp/errors.rb
spoom-1.0.4 lib/spoom/sorbet/lsp/errors.rb