Class: LanguageServer::Protocol::Interface::InitializeResult
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::InitializeResult
- Defined in:
- lib/language_server/protocol/interface/initialize_result.rb
Overview
The result returned from an initialize request.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#capabilities ⇒ ServerCapabilities
The capabilities the language server provides.
-
#initialize(capabilities:, server_info: nil) ⇒ InitializeResult
constructor
A new instance of InitializeResult.
-
#server_info ⇒ { name:string, version:string } | nil
Information about the server.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(capabilities:, server_info: nil) ⇒ InitializeResult
Returns a new instance of InitializeResult.
8 9 10 11 12 13 14 15 |
# File 'lib/language_server/protocol/interface/initialize_result.rb', line 8 def initialize(capabilities:, server_info: nil) @attributes = {} @attributes[:capabilities] = capabilities @attributes[:serverInfo] = server_info if server_info @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
35 36 37 |
# File 'lib/language_server/protocol/interface/initialize_result.rb', line 35 def attributes @attributes end |
Instance Method Details
#capabilities ⇒ ServerCapabilities
The capabilities the language server provides.
21 22 23 |
# File 'lib/language_server/protocol/interface/initialize_result.rb', line 21 def capabilities attributes.fetch(:capabilities) end |
#server_info ⇒ { name:string, version:string } | nil
Information about the server.
31 32 33 |
# File 'lib/language_server/protocol/interface/initialize_result.rb', line 31 def server_info attributes.fetch(:serverInfo) end |
#to_hash ⇒ Object
37 38 39 |
# File 'lib/language_server/protocol/interface/initialize_result.rb', line 37 def to_hash attributes end |
#to_json(*args) ⇒ Object
41 42 43 |
# File 'lib/language_server/protocol/interface/initialize_result.rb', line 41 def to_json(*args) to_hash.to_json(*args) end |