Class: PuppetLanguageServer::DisabledMessageHandler
- Inherits:
-
PuppetEditorServices::Handler::JsonRPC
- Object
- PuppetEditorServices::Handler::Base
- PuppetEditorServices::Handler::JsonRPC
- PuppetLanguageServer::DisabledMessageHandler
- Defined in:
- lib/puppet-languageserver/message_handler.rb
Instance Attribute Summary
Attributes inherited from PuppetEditorServices::Handler::Base
Instance Method Summary collapse
- #notification_exit(_, _json_rpc_message) ⇒ Object
- #notification_initialized(_, _json_rpc_message) ⇒ Object
- #request_initialize(_, _json_rpc_message) ⇒ Object
- #request_puppet_getversion(_, _json_rpc_message) ⇒ Object
- #request_shutdown(_, _json_rpc_message) ⇒ Object
Methods inherited from PuppetEditorServices::Handler::JsonRPC
Methods inherited from PuppetEditorServices::Handler::Base
Constructor Details
This class inherits a constructor from PuppetEditorServices::Handler::Base
Instance Method Details
#notification_exit(_, _json_rpc_message) ⇒ Object
457 458 459 460 |
# File 'lib/puppet-languageserver/message_handler.rb', line 457 def notification_exit(_, ) PuppetLanguageServer.(:info, 'Received exit notification. Closing connection to client...') protocol.close_connection end |
#notification_initialized(_, _json_rpc_message) ⇒ Object
445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/puppet-languageserver/message_handler.rb', line 445 def notification_initialized(_, ) PuppetLanguageServer.(:info, 'Client has received initialization') protocol.encode_and_send( ::PuppetEditorServices::Protocol::JsonRPCMessages.new_notification( 'window/showMessage', 'type' => LSP::MessageType::WARNING, 'message' => 'An error occured while starting the Language Server. The server has been disabled.' ) ) end |
#request_initialize(_, _json_rpc_message) ⇒ Object
420 421 422 423 424 |
# File 'lib/puppet-languageserver/message_handler.rb', line 420 def request_initialize(_, ) PuppetLanguageServer.(:debug, 'Received initialize method') # If the Language Server is not active then we can not respond to any capability { 'capabilities' => PuppetLanguageServer::ServerCapabilites.no_capabilities } end |
#request_puppet_getversion(_, _json_rpc_message) ⇒ Object
431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/puppet-languageserver/message_handler.rb', line 431 def request_puppet_getversion(_, ) # Clients may use the getVersion request to figure out when the server has "finished" loading. In this # case just fake the response that we are fully loaded with unknown gem versions LSP::PuppetVersion.new( 'languageServerVersion' => PuppetEditorServices.version, 'puppetVersion' => 'Unknown', 'facterVersion' => 'Unknown', 'factsLoaded' => true, 'functionsLoaded' => true, 'typesLoaded' => true, 'classesLoaded' => true ) end |
#request_shutdown(_, _json_rpc_message) ⇒ Object
426 427 428 429 |
# File 'lib/puppet-languageserver/message_handler.rb', line 426 def request_shutdown(_, ) PuppetLanguageServer.(:debug, 'Received shutdown method') nil end |