Sha256: bc80bd17b3fd691b57c76edb9052d22105749574c28d5fb2460dea4d1f842f97

Contents?: true

Size: 774 Bytes

Versions: 6

Compression:

Stored size: 774 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

6 entries across 6 versions & 1 rubygems

Version Path
ruby-lsp-0.3.8 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.7 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.6 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.5 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.4 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb
ruby-lsp-0.3.3 lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb