Class: LanguageServer::Protocol::Interfaces::ServerCapabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interfaces/server_capabilities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text_document_sync: nil, hover_provider: nil, completion_provider: nil, signature_help_provider: nil, definition_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, workspace_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, document_link_provider: nil, execute_command_provider: nil, experimental: nil) ⇒ ServerCapabilities

Returns a new instance of ServerCapabilities.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 5

def initialize(text_document_sync: nil, hover_provider: nil, completion_provider: nil, signature_help_provider: nil, definition_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, workspace_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, document_link_provider: nil, execute_command_provider: nil, experimental: nil)
  @attributes = {}

  @attributes[:textDocumentSync] = text_document_sync if text_document_sync
  @attributes[:hoverProvider] = hover_provider if hover_provider
  @attributes[:completionProvider] = completion_provider if completion_provider
  @attributes[:signatureHelpProvider] = signature_help_provider if signature_help_provider
  @attributes[:definitionProvider] = definition_provider if definition_provider
  @attributes[:referencesProvider] = references_provider if references_provider
  @attributes[:documentHighlightProvider] = document_highlight_provider if document_highlight_provider
  @attributes[:documentSymbolProvider] = document_symbol_provider if document_symbol_provider
  @attributes[:workspaceSymbolProvider] = workspace_symbol_provider if workspace_symbol_provider
  @attributes[:codeActionProvider] = code_action_provider if code_action_provider
  @attributes[:codeLensProvider] = code_lens_provider if code_lens_provider
  @attributes[:documentFormattingProvider] = document_formatting_provider if document_formatting_provider
  @attributes[:documentRangeFormattingProvider] = document_range_formatting_provider if document_range_formatting_provider
  @attributes[:documentOnTypeFormattingProvider] = document_on_type_formatting_provider if document_on_type_formatting_provider
  @attributes[:renameProvider] = rename_provider if rename_provider
  @attributes[:documentLinkProvider] = document_link_provider if document_link_provider
  @attributes[:executeCommandProvider] = execute_command_provider if execute_command_provider
  @attributes[:experimental] = experimental if experimental

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



175
176
177
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 175

def attributes
  @attributes
end

Instance Method Details

#code_action_providerboolean

The server provides code actions.

Returns:

  • (boolean)


107
108
109
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 107

def code_action_provider
  attributes.fetch(:codeActionProvider)
end

#code_lens_providerCodeLensOptions

The server provides code lens.

Returns:



115
116
117
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 115

def code_lens_provider
  attributes.fetch(:codeLensProvider)
end

#completion_providerCompletionOptions

The server provides completion support.

Returns:



51
52
53
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 51

def completion_provider
  attributes.fetch(:completionProvider)
end

#definition_providerboolean

The server provides goto definition support.

Returns:

  • (boolean)


67
68
69
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 67

def definition_provider
  attributes.fetch(:definitionProvider)
end

#document_formatting_providerboolean

The server provides document formatting.

Returns:

  • (boolean)


123
124
125
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 123

def document_formatting_provider
  attributes.fetch(:documentFormattingProvider)
end

#document_highlight_providerboolean

The server provides document highlight support.

Returns:

  • (boolean)


83
84
85
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 83

def document_highlight_provider
  attributes.fetch(:documentHighlightProvider)
end

The server provides document link support.

Returns:



155
156
157
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 155

def document_link_provider
  attributes.fetch(:documentLinkProvider)
end

#document_on_type_formatting_providerDocumentOnTypeFormattingOptions

The server provides document formatting on typing.



139
140
141
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 139

def document_on_type_formatting_provider
  attributes.fetch(:documentOnTypeFormattingProvider)
end

#document_range_formatting_providerboolean

The server provides document range formatting.

Returns:

  • (boolean)


131
132
133
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 131

def document_range_formatting_provider
  attributes.fetch(:documentRangeFormattingProvider)
end

#document_symbol_providerboolean

The server provides document symbol support.

Returns:

  • (boolean)


91
92
93
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 91

def document_symbol_provider
  attributes.fetch(:documentSymbolProvider)
end

#execute_command_providerExecuteCommandOptions

The server provides execute command support.



163
164
165
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 163

def execute_command_provider
  attributes.fetch(:executeCommandProvider)
end

#experimentalany

Experimental server capabilities.

Returns:

  • (any)


171
172
173
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 171

def experimental
  attributes.fetch(:experimental)
end

#hover_providerboolean

The server provides hover support.

Returns:

  • (boolean)


43
44
45
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 43

def hover_provider
  attributes.fetch(:hoverProvider)
end

#references_providerboolean

The server provides find references support.

Returns:

  • (boolean)


75
76
77
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 75

def references_provider
  attributes.fetch(:referencesProvider)
end

#rename_providerboolean

The server provides rename support.

Returns:

  • (boolean)


147
148
149
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 147

def rename_provider
  attributes.fetch(:renameProvider)
end

#signature_help_providerSignatureHelpOptions

The server provides signature help support.



59
60
61
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 59

def signature_help_provider
  attributes.fetch(:signatureHelpProvider)
end

#text_document_syncnumber | TextDocumentSyncOptions

Defines how text documents are synced. Is either a detailed structure defining each notification or for backwards compatibility the TextDocumentSyncKind number.

Returns:



35
36
37
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 35

def text_document_sync
  attributes.fetch(:textDocumentSync)
end

#to_json(*args) ⇒ Object



177
178
179
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 177

def to_json(*args)
  attributes.to_json(*args)
end

#workspace_symbol_providerboolean

The server provides workspace symbol support.

Returns:

  • (boolean)


99
100
101
# File 'lib/language_server/protocol/interfaces/server_capabilities.rb', line 99

def workspace_symbol_provider
  attributes.fetch(:workspaceSymbolProvider)
end