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

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

Overview

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SemanticTokensDelta.

Since:

  • 3.16.0



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

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)

Since:

  • 3.16.0



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

def attributes
  @attributes
end

Instance Method Details

#editsSemanticTokensEdit[]

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

Returns:

Since:

  • 3.16.0



26
27
28
# File 'lib/language_server/protocol/interface/semantic_tokens_delta.rb', line 26

def edits
  attributes.fetch(:edits)
end

#result_idstring | nil

Returns:

  • (string | nil)

Since:

  • 3.16.0



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

def result_id
  attributes.fetch(:resultId)
end

#to_hashObject

Since:

  • 3.16.0



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.16.0



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

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