Class: Rucoa::Handlers::TextDocumentCodeActionHandler::DiagnosticToCodeActionMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rucoa/handlers/text_document_code_action_handler.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(diagnostic) ⇒ DiagnosticToCodeActionMapper

Returns a new instance of DiagnosticToCodeActionMapper.

Parameters:

  • diagnostic (Hash)


45
46
47
# File 'lib/rucoa/handlers/text_document_code_action_handler.rb', line 45

def initialize(diagnostic)
  @diagnostic = diagnostic
end

Class Method Details

.call(diagnostic) ⇒ Hash

Parameters:

  • diagnostic (Hash)

Returns:

  • (Hash)


39
40
41
# File 'lib/rucoa/handlers/text_document_code_action_handler.rb', line 39

def call(diagnostic)
  new(diagnostic).call
end

Instance Method Details

#callHash

Returns:

  • (Hash)


50
51
52
53
54
55
56
57
58
# File 'lib/rucoa/handlers/text_document_code_action_handler.rb', line 50

def call
  {
    diagnostics: diagnostics,
    edit: edit,
    isPreferred: preferred?,
    kind: kind,
    title: title
  }
end