Class: LanguageServer::Protocol::Interface::InitializeParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::InitializeParams
- Defined in:
- lib/language_server/protocol/interface/initialize_params.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#capabilities ⇒ ClientCapabilities
The capabilities provided by the client (editor or tool).
-
#initialization_options ⇒ any
User provided initialization options.
-
#initialize(process_id:, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil) ⇒ InitializeParams
constructor
A new instance of InitializeParams.
-
#process_id ⇒ number
The process Id of the parent process that started the server.
-
#root_path ⇒ string
The rootPath of the workspace.
-
#root_uri ⇒ string
The rootUri of the workspace.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#trace ⇒ "off" | "messages" | "verbose"
The initial trace setting.
Constructor Details
#initialize(process_id:, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil) ⇒ InitializeParams
Returns a new instance of InitializeParams.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 5 def initialize(process_id:, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil) @attributes = {} @attributes[:processId] = process_id @attributes[:rootPath] = root_path if root_path @attributes[:rootUri] = root_uri @attributes[:initializationOptions] = if @attributes[:capabilities] = capabilities @attributes[:trace] = trace if trace @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
71 72 73 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 71 def attributes @attributes end |
Instance Method Details
#capabilities ⇒ ClientCapabilities
The capabilities provided by the client (editor or tool)
59 60 61 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 59 def capabilities attributes.fetch(:capabilities) end |
#initialization_options ⇒ any
User provided initialization options.
51 52 53 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 51 def attributes.fetch(:initializationOptions) end |
#process_id ⇒ number
The process Id of the parent process that started the server. Is null if the process has not been started by another process. If the parent process is not alive then the server should exit (see exit notification) its process.
24 25 26 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 24 def process_id attributes.fetch(:processId) end |
#root_path ⇒ string
The rootPath of the workspace. Is null if no folder is open.
33 34 35 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 33 def root_path attributes.fetch(:rootPath) end |
#root_uri ⇒ string
The rootUri of the workspace. Is null if no folder is open. If both ‘rootPath` and `rootUri` are set `rootUri` wins.
43 44 45 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 43 def root_uri attributes.fetch(:rootUri) end |
#to_hash ⇒ Object
73 74 75 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 73 def to_hash attributes end |
#to_json(*args) ⇒ Object
77 78 79 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 77 def to_json(*args) to_hash.to_json(*args) end |
#trace ⇒ "off" | "messages" | "verbose"
The initial trace setting. If omitted trace is disabled (‘off’).
67 68 69 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 67 def trace attributes.fetch(:trace) end |