Class: LanguageServer::Protocol::Interface::SemanticTokensDelta

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result_id: nil, edits:) ⇒ SemanticTokensDelta

Returns a new instance of SemanticTokensDelta.



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

def initialize(result_id: nil, edits:)
  @attributes = {}

  @attributes[:resultId] = result_id if result_id
  @attributes[:edits] = edits

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#editsSemanticTokensEdit[]

The semantic token edits to transform a previous result into a new result.

Returns:



24
25
26
# File 'lib/language_server/protocol/interface/semantic_tokens_delta.rb', line 24

def edits
  attributes.fetch(:edits)
end

#result_idstring

Returns:

  • (string)


15
16
17
# File 'lib/language_server/protocol/interface/semantic_tokens_delta.rb', line 15

def result_id
  attributes.fetch(:resultId)
end

#to_hashObject



30
31
32
# File 'lib/language_server/protocol/interface/semantic_tokens_delta.rb', line 30

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



34
35
36
# File 'lib/language_server/protocol/interface/semantic_tokens_delta.rb', line 34

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