Class: RubyLsp::Requests::Support::SyntaxErrorDiagnostic

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb

Instance Method Summary collapse

Constructor Details

#initialize(edit) ⇒ SyntaxErrorDiagnostic

Returns a new instance of SyntaxErrorDiagnostic.



11
12
13
# File 'lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb', line 11

def initialize(edit)
  @edit = edit
end

Instance Method Details

#correctable?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb', line 16

def correctable?
  false
end

#to_lsp_diagnosticObject



21
22
23
24
25
26
27
28
# File 'lib/ruby_lsp/requests/support/syntax_error_diagnostic.rb', line 21

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