Class: LanguageServer::Protocol::Interface::TextDocumentSyncOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(open_close: nil, change: nil, will_save: nil, will_save_wait_until: nil, save: nil) ⇒ TextDocumentSyncOptions

Returns a new instance of TextDocumentSyncOptions.



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

def initialize(open_close: nil, change: nil, will_save: nil, will_save_wait_until: nil, save: nil)
  @attributes = {}

  @attributes[:openClose] = open_close if open_close
  @attributes[:change] = change if change
  @attributes[:willSave] = will_save if will_save
  @attributes[:willSaveWaitUntil] = will_save_wait_until if will_save_wait_until
  @attributes[:save] = save if save

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



62
63
64
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 62

def attributes
  @attributes
end

Instance Method Details

#changeTextDocumentSyncKind | nil

Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.

Returns:

  • (TextDocumentSyncKind | nil)


31
32
33
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 31

def change
  attributes.fetch(:change)
end

#open_closeboolean | nil

Open and close notifications are sent to the server. If omitted open close notifications should not be sent.

Returns:

  • (boolean | nil)


22
23
24
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 22

def open_close
  attributes.fetch(:openClose)
end

#saveboolean | SaveOptions | nil

If present save notifications are sent to the server. If omitted the notification should not be sent.

Returns:



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

def save
  attributes.fetch(:save)
end

#to_hashObject



64
65
66
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 64

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



68
69
70
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 68

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

#will_saveboolean | nil

If present will save notifications are sent to the server. If omitted the notification should not be sent.

Returns:

  • (boolean | nil)


40
41
42
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 40

def will_save
  attributes.fetch(:willSave)
end

#will_save_wait_untilboolean | nil

If present will save wait until requests are sent to the server. If omitted the request should not be sent.

Returns:

  • (boolean | nil)


49
50
51
# File 'lib/language_server/protocol/interface/text_document_sync_options.rb', line 49

def will_save_wait_until
  attributes.fetch(:willSaveWaitUntil)
end