Class: LanguageServer::Protocol::Interface::WorkspaceFoldersServerCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(supported: nil, change_notifications: nil) ⇒ WorkspaceFoldersServerCapabilities

Returns a new instance of WorkspaceFoldersServerCapabilities.



5
6
7
8
9
10
11
12
# File 'lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb', line 5

def initialize(supported: nil, change_notifications: nil)
  @attributes = {}

  @attributes[:supported] = supported if supported
  @attributes[:changeNotifications] = change_notifications if change_notifications

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



36
37
38
# File 'lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb', line 36

def attributes
  @attributes
end

Instance Method Details

#change_notificationsstring | boolean

Whether the server wants to receive workspace folder change notifications.

If a string is provided, the string is treated as an ID under which the notification is registered on the client side. The ID can be used to unregister for these events using the ‘client/unregisterCapability` request.

Returns:

  • (string | boolean)


32
33
34
# File 'lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb', line 32

def change_notifications
  attributes.fetch(:changeNotifications)
end

#supportedboolean

The server has support for workspace folders

Returns:

  • (boolean)


18
19
20
# File 'lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb', line 18

def supported
  attributes.fetch(:supported)
end

#to_hashObject



38
39
40
# File 'lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb', line 38

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



42
43
44
# File 'lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb', line 42

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