Class: LanguageServer::Protocol::Interface::InitializeParams

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/initialize_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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] = initialization_options if initialization_options
  @attributes[:capabilities] = capabilities
  @attributes[:trace] = trace if trace
  @attributes[:workspaceFolders] = workspace_folders if workspace_folders

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (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

#capabilitiesClientCapabilities

The capabilities provided by the client (editor or tool)

Returns:



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

Returns:

  • ({ name: string; version?: string; })


45
46
47
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 45

def client_info
  attributes.fetch(:clientInfo)
end

#initialization_optionsLSPAny

User provided initialization options.

Returns:

  • (LSPAny)


85
86
87
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 85

def initialization_options
  attributes.fetch(:initializationOptions)
end

#localestring

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)

Returns:

  • (string)


58
59
60
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 58

def locale
  attributes.fetch(:locale)
end

#process_idnumber

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.

Returns:

  • (number)


37
38
39
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 37

def process_id
  attributes.fetch(:processId)
end

#root_pathstring

The rootPath of the workspace. Is null if no folder is open.

Returns:

  • (string)


67
68
69
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 67

def root_path
  attributes.fetch(:rootPath)
end

#root_uristring

The rootUri of the workspace. Is null if no folder is open. If both ‘rootPath` and `rootUri` are set `rootUri` wins.

Returns:

  • (string)


77
78
79
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 77

def root_uri
  attributes.fetch(:rootUri)
end

#to_hashObject



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

#traceTraceValue

The initial trace setting. If omitted trace is disabled (‘off’).

Returns:

  • (TraceValue)


101
102
103
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 101

def trace
  attributes.fetch(:trace)
end

#work_done_tokenProgressToken

An optional token that a server can use to report work done progress.

Returns:

  • (ProgressToken)


26
27
28
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 26

def work_done_token
  attributes.fetch(:workDoneToken)
end

#workspace_foldersWorkspaceFolder[]

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.

Returns:



112
113
114
# File 'lib/language_server/protocol/interface/initialize_params.rb', line 112

def workspace_folders
  attributes.fetch(:workspaceFolders)
end