Sha256: f2b71b2e809cf30a758ced98590e67f1be6e0fbb0f650d200f523221967978a7

Contents?: true

Size: 773 Bytes

Versions: 9

Compression:

Stored size: 773 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module RubyLsp
  module Requests
    module Support
      class SyntaxErrorDiagnostic
        extend T::Sig

        sig { params(edit: Document::EditShape).void }
        def initialize(edit)
          @edit = edit
        end

        sig { returns(FalseClass) }
        def correctable?
          false
        end

        sig { returns(LanguageServer::Protocol::Interface::Diagnostic) }
        def to_lsp_diagnostic
          LanguageServer::Protocol::Interface::Diagnostic.new(
            message: "Syntax error",
            source: "SyntaxTree",
            severity: LanguageServer::Protocol::Constant::DiagnosticSeverity::ERROR,
            range: @edit[:range]
          )
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruby-lsp-0.3.2 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.1 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.0 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.2.4 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.2.3 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.2.2 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.2.1 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.2.0 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.1.0 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb