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 } | nil
Information about the client.
-
#initialization_options ⇒ LSPAny | nil
User provided initialization options.
-
#initialize(process_id:, client_info: nil, locale: nil, root_path: nil, root_uri:, capabilities:, initialization_options: nil, trace: nil, work_done_token: nil, workspace_folders: nil) ⇒ InitializeParams
constructor
A new instance of InitializeParams.
-
#locale ⇒ string | nil
The locale the client is currently showing the user interface in.
-
#process_id ⇒ integer | null
The process Id of the parent process that started the server.
-
#root_path ⇒ string | null
deprecated
Deprecated.
in favour of rootUri.
-
#root_uri ⇒ DocumentUri | null
deprecated
Deprecated.
in favour of workspaceFolders.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#trace ⇒ "off" | "messages" | "compact" | "verbose" | nil
The initial trace setting.
-
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
-
#workspace_folders ⇒ WorkspaceFolder[] | null
The workspace folders configured in the client when the server starts.
Constructor Details
#initialize(process_id:, client_info: nil, locale: nil, root_path: nil, root_uri:, capabilities:, initialization_options: nil, trace: nil, work_done_token: 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(process_id:, client_info: nil, locale: nil, root_path: nil, root_uri:, capabilities:, initialization_options: nil, trace: nil, work_done_token: nil, workspace_folders: nil) @attributes = {} @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[:capabilities] = capabilities @attributes[:initializationOptions] = if @attributes[:trace] = trace if trace @attributes[:workDoneToken] = work_done_token if work_done_token @attributes[:workspaceFolders] = workspace_folders if workspace_folders @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
128 129 130 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 128 def attributes @attributes end |
Instance Method Details
#capabilities ⇒ ClientCapabilities
The capabilities provided by the client (editor or tool)
86 87 88 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 86 def capabilities attributes.fetch(:capabilities) end |
#client_info ⇒ { name:string, version:string } | nil
Information about the client
40 41 42 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 40 def client_info attributes.fetch(:clientInfo) end |
#initialization_options ⇒ LSPAny | nil
User provided initialization options.
94 95 96 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 94 def attributes.fetch(:initializationOptions) end |
#locale ⇒ string | nil
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)
55 56 57 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 55 def locale attributes.fetch(:locale) end |
#process_id ⇒ integer | null
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.
30 31 32 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 30 def process_id attributes.fetch(:processId) end |
#root_path ⇒ string | null
in favour of rootUri.
The rootPath of the workspace. Is null if no folder is open.
66 67 68 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 66 def root_path attributes.fetch(:rootPath) end |
#root_uri ⇒ DocumentUri | null
in favour of workspaceFolders.
The rootUri of the workspace. Is null if no folder is open. If both rootPath and rootUri are set rootUri wins.
78 79 80 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 78 def root_uri attributes.fetch(:rootUri) end |
#to_hash ⇒ Object
130 131 132 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 130 def to_hash attributes end |
#to_json(*args) ⇒ Object
134 135 136 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 134 def to_json(*args) to_hash.to_json(*args) end |
#trace ⇒ "off" | "messages" | "compact" | "verbose" | nil
The initial trace setting. If omitted trace is disabled (‘off’).
102 103 104 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 102 def trace attributes.fetch(:trace) end |
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
110 111 112 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 110 def work_done_token attributes.fetch(:workDoneToken) end |
#workspace_folders ⇒ WorkspaceFolder[] | null
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.
124 125 126 |
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 124 def workspace_folders attributes.fetch(:workspaceFolders) end |