Class: LanguageServer::Protocol::Interface::InitializeParams
- Inherits:
-
WorkDoneProgressParams
- Object
- WorkDoneProgressParams
- 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).
-
#client_info ⇒ { name: string; version?: string; }
Information about the client.
-
#initialization_options ⇒ any
User provided initialization options.
-
#initialize(work_done_token: nil, process_id:, client_info: nil, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil, workspace_folders: 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.
-
#workspace_folders ⇒ WorkspaceFolder[]
The workspace folders configured in the client when the server starts.
Methods inherited from WorkDoneProgressParams
Constructor Details
#initialize(work_done_token: nil, process_id:, client_info: nil, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil, workspace_folders: nil) ⇒ InitializeParams
Returns a new instance of InitializeParams.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 5 def initialize(work_done_token: nil, process_id:, client_info: nil, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil, workspace_folders: nil) @attributes = {} @attributes[:workDoneToken] = work_done_token if work_done_token @attributes[:processId] = process_id @attributes[:clientInfo] = client_info if client_info @attributes[:rootPath] = root_path if root_path @attributes[:rootUri] = root_uri @attributes[:initializationOptions] = if @attributes[:capabilities] = capabilities @attributes[:trace] = trace if trace @attributes[:workspaceFolders] = workspace_folders if workspace_folders @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
93 94 95 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 93 def attributes @attributes end |
Instance Method Details
#capabilities ⇒ ClientCapabilities
The capabilities provided by the client (editor or tool)
70 71 72 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 70 def capabilities attributes.fetch(:capabilities) end |
#client_info ⇒ { name: string; version?: string; }
Information about the client
35 36 37 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 35 def client_info attributes.fetch(:clientInfo) end |
#initialization_options ⇒ any
User provided initialization options.
62 63 64 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 62 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.
27 28 29 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 27 def process_id attributes.fetch(:processId) end |
#root_path ⇒ string
The rootPath of the workspace. Is null if no folder is open.
44 45 46 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 44 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.
54 55 56 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 54 def root_uri attributes.fetch(:rootUri) end |
#to_hash ⇒ Object
95 96 97 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 95 def to_hash attributes end |
#to_json(*args) ⇒ Object
99 100 101 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 99 def to_json(*args) to_hash.to_json(*args) end |
#trace ⇒ "off" | "messages" | "verbose"
The initial trace setting. If omitted trace is disabled (‘off’).
78 79 80 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 78 def trace attributes.fetch(:trace) end |
#workspace_folders ⇒ WorkspaceFolder[]
The workspace folders configured in the client when the server starts. This property is only available if the client supports workspace folders. It can be ‘null` if the client supports workspace folders but none are configured.
89 90 91 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 89 def workspace_folders attributes.fetch(:workspaceFolders) end |