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

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

Overview

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SemanticTokensEdit.

Parameters:

  • start: (Integer)
  • delete_count: (Integer)
  • data: (Array[Integer]) (defaults to: nil)

Since:

  • 3.16.0



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

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

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.16.0



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

def attributes
  @attributes
end

Instance Method Details

#datauinteger[]

The elements to insert.

Returns:

  • (uinteger[])

Since:

  • 3.16.0



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

def data
  attributes.fetch(:data)
end

#delete_countuinteger

The count of elements to remove.

Returns:

  • (uinteger)

Since:

  • 3.16.0



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

def delete_count
  attributes.fetch(:deleteCount)
end

#startuinteger

The start offset of the edit.

Returns:

  • (uinteger)

Since:

  • 3.16.0



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

def start
  attributes.fetch(:start)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.16.0



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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

Since:

  • 3.16.0



48
49
50
# File 'lib/language_server/protocol/interface/semantic_tokens_edit.rb', line 48

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