Class: TypeProf::LSP::Message::TextDocument::DidOpen

Inherits:
TypeProf::LSP::Message show all
Defined in:
lib/typeprof/lsp/messages.rb

Constant Summary collapse

METHOD =

notification

"textDocument/didOpen"

Constants inherited from TypeProf::LSP::Message

Classes, TypeProf::LSP::Message::Table

Instance Method Summary collapse

Methods inherited from TypeProf::LSP::Message

build_table, find, inherited, #initialize, #log, #notify, #respond, #respond_error

Constructor Details

This class inherits a constructor from TypeProf::LSP::Message

Instance Method Details

#runObject



131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/typeprof/lsp/messages.rb', line 131

def run
  @params => { textDocument: { uri:, version:, text: } }

  path = @server.uri_to_path(uri)
  return unless @server.target_path?(path)

  text = Text.new(path, text, version)
  @server.open_texts[uri] = text
  @server.core.update_file(text.path, text.string)
  @server.send_request("workspace/codeLens/refresh")
  @server.publish_diagnostics(uri)
end