Class: LanguageServer::Protocol::Interface::SemanticTokensEdit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start:, delete_count:, data: nil) ⇒ SemanticTokensEdit

Returns a new instance of SemanticTokensEdit.



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

def initialize(start:, delete_count:, data: nil)
  @attributes = {}

  @attributes[:start] = start
  @attributes[:deleteCount] = delete_count
  @attributes[:data] = data if data

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



39
40
41
# File 'lib/language_server/protocol/interface/semantic_tokens_edit.rb', line 39

def attributes
  @attributes
end

Instance Method Details

#datanumber[]

The elements to insert.

Returns:

  • (number[])


35
36
37
# File 'lib/language_server/protocol/interface/semantic_tokens_edit.rb', line 35

def data
  attributes.fetch(:data)
end

#delete_countnumber

The count of elements to remove.

Returns:

  • (number)


27
28
29
# File 'lib/language_server/protocol/interface/semantic_tokens_edit.rb', line 27

def delete_count
  attributes.fetch(:deleteCount)
end

#startnumber

The start offset of the edit.

Returns:

  • (number)


19
20
21
# File 'lib/language_server/protocol/interface/semantic_tokens_edit.rb', line 19

def start
  attributes.fetch(:start)
end

#to_hashObject



41
42
43
# File 'lib/language_server/protocol/interface/semantic_tokens_edit.rb', line 41

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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