class RubyLsp::Requests::Support::TestItem

used to represent test files, directories or workspaces
Note: this test item object can only represent test groups or examples discovered inside files. It cannot be
See code.visualstudio.com/api/references/vscode-api#TestItem<br>Represents a test item as defined by the VS Code interface to be used in the test explorer

def [](id)

: (String id) -> TestItem?
def [](id)
  @children[id]
end

def add(item)

: (TestItem item) -> void
def add(item)
  @children[item.id] = item
end

def children

: -> Array[TestItem]
def children
  @children.values
end

def initialize(id, label, uri, range, framework:)

: (String id, String label, URI::Generic uri, Interface::Range range, framework: Symbol) -> void
def initialize(id, label, uri, range, framework:)
  @id = id
  @label = label
  @uri = uri
  @range = range
  @tags = ["framework:#{framework}"] #: Array[String]
  @children = {} #: Hash[String, TestItem]
end

def to_hash

: -> Hash[Symbol, untyped]
def to_hash
  {
    id: @id,
    label: @label,
    uri: @uri,
    range: @range,
    tags: @tags,
    children: children.map(&:to_hash),
  }
end