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).
-
#client_info ⇒ { name: string; version?: string; }
Information about the client.
-
#initialization_options ⇒ LSPAny
User provided initialization options.
-
#initialize(work_done_token: nil, process_id:, client_info: nil, locale: nil, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil, workspace_folders: nil) ⇒ InitializeParams
constructor
A new instance of InitializeParams.
-
#locale ⇒ string
The locale the client is currently showing the user interface in.
-
#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 ⇒ TraceValue
The initial trace setting.
-
#work_done_token ⇒ ProgressToken
An optional token that a server can use to report work done progress.
-
#workspace_folders ⇒ WorkspaceFolder[]
The workspace folders configured in the client when the server starts.
Constructor Details
#initialize(work_done_token: nil, process_id:, client_info: nil, locale: 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 20 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 5 def initialize(work_done_token: nil, process_id:, client_info: nil, locale: 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[:locale] = locale if locale @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.
116 117 118 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 116 def attributes @attributes end |
Instance Method Details
#capabilities ⇒ ClientCapabilities
The capabilities provided by the client (editor or tool)
93 94 95 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 93 def capabilities attributes.fetch(:capabilities) end |
#client_info ⇒ { name: string; version?: string; }
Information about the client
45 46 47 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 45 def client_info attributes.fetch(:clientInfo) end |
#initialization_options ⇒ LSPAny
User provided initialization options.
85 86 87 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 85 def attributes.fetch(:initializationOptions) end |
#locale ⇒ string
The locale the client is currently showing the user interface in. This must not necessarily be the locale of the operating system.
Uses IETF language tags as the value’s syntax (See en.wikipedia.org/wiki/IETF_language_tag)
58 59 60 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 58 def locale attributes.fetch(:locale) 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.
37 38 39 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 37 def process_id attributes.fetch(:processId) end |
#root_path ⇒ string
The rootPath of the workspace. Is null if no folder is open.
67 68 69 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 67 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.
77 78 79 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 77 def root_uri attributes.fetch(:rootUri) end |
#to_hash ⇒ Object
118 119 120 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 118 def to_hash attributes end |
#to_json(*args) ⇒ Object
122 123 124 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 122 def to_json(*args) to_hash.to_json(*args) end |
#trace ⇒ TraceValue
The initial trace setting. If omitted trace is disabled (‘off’).
101 102 103 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 101 def trace attributes.fetch(:trace) end |
#work_done_token ⇒ ProgressToken
An optional token that a server can use to report work done progress.
26 27 28 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 26 def work_done_token attributes.fetch(:workDoneToken) 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.
112 113 114 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 112 def workspace_folders attributes.fetch(:workspaceFolders) end |