Class: LanguageServer::Protocol::Interface::TextDocumentSyncClientCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dynamic_registration: nil, will_save: nil, will_save_wait_until: nil, did_save: nil) ⇒ TextDocumentSyncClientCapabilities

Returns a new instance of TextDocumentSyncClientCapabilities.



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

def initialize(dynamic_registration: nil, will_save: nil, will_save_wait_until: nil, did_save: nil)
  @attributes = {}

  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
  @attributes[:willSave] = will_save if will_save
  @attributes[:willSaveWaitUntil] = will_save_wait_until if will_save_wait_until
  @attributes[:didSave] = did_save if did_save

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



50
51
52
# File 'lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb', line 50

def attributes
  @attributes
end

Instance Method Details

#did_saveboolean

The client supports did save notifications.

Returns:

  • (boolean)


46
47
48
# File 'lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb', line 46

def did_save
  attributes.fetch(:didSave)
end

#dynamic_registrationboolean

Whether text document synchronization supports dynamic registration.

Returns:

  • (boolean)


20
21
22
# File 'lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb', line 20

def dynamic_registration
  attributes.fetch(:dynamicRegistration)
end

#to_hashObject



52
53
54
# File 'lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb', line 52

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



56
57
58
# File 'lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb', line 56

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

#will_saveboolean

The client supports sending will save notifications.

Returns:

  • (boolean)


28
29
30
# File 'lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb', line 28

def will_save
  attributes.fetch(:willSave)
end

#will_save_wait_untilboolean

The client supports sending a will save request and waits for a response providing text edits which will be applied to the document before it is saved.

Returns:

  • (boolean)


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

def will_save_wait_until
  attributes.fetch(:willSaveWaitUntil)
end