class TypeProf::LSP::Message::TextDocument::Completion

Constants

METHOD

Public Instance Methods

run() click to toggle source
# File typeprof-0.21.11/lib/typeprof/lsp.rb, line 682
def run
  case @params
  in {
    textDocument: { uri:, },
    position: loc,
    context: {
      triggerKind: trigger_kind
    },
  }
  in {
    textDocument: { uri:, },
    position: loc,
  }
    trigger_kind = 1
  else
    raise
  end

  items = @server.open_texts[uri]&.code_complete(loc, trigger_kind)

  if items
    respond(
      {
        isIncomplete: true,
        items: items
      }
    )
  else
    respond(nil)
  end
end