Class: TypeProf::LSP::Message
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
|
Classes:
| |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
CancelRequest, Exit, Initialize, Initialized, Shutdown, TextDocument::CodeLens, TextDocument::Completion, TextDocument::Definition, TextDocument::DidChange, TextDocument::DidClose, TextDocument::DidOpen, TextDocument::Hover, TextDocument::References, TextDocument::Rename, TextDocument::TypeDefinition, Workspace::ExecuteCommand
|
|
| Inherits: | Object |
| Defined in: | lib/typeprof/lsp/messages.rb |
Constant Summary
-
Classes =
# File 'lib/typeprof/lsp/messages.rb', line 32[]
-
Table =
# File 'lib/typeprof/lsp/messages.rb', line 37Hash.new(Message)
Class Method Summary
- .build_table
- .find(method)
- .inherited(klass)
-
.new(server, json) ⇒ Message
constructor
: (Server, untyped) -> void.
Instance Method Summary
Constructor Details
.new(server, json) ⇒ Message
: (Server, untyped) -> void
# File 'lib/typeprof/lsp/messages.rb', line 4
def initialize(server, json) @server = server @id = json[:id] @method = json[:method] @params = json[:params] end
Class Method Details
.build_table
[ GitHub ].find(method)
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 44
def self.find(method) Table[method] end
.inherited(klass)
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 33
def self.inherited(klass) Classes << klass end
Instance Method Details
#log(msg)
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 15
def log(msg) end
#notify(method, **params)
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 28
def notify(method, **params) @server.send_notification(method, **params) end
#respond(result)
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 18
def respond(result) raise "do not respond to notification" if @id == nil @server.send_response(id: @id, result: result) end
#respond_error(error)
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 23
def respond_error(error) raise "do not respond to notification" if @id == nil @server.send_response(id: @id, error: error) end
#run
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 11
def run p [:ignored, @method] end