class LanguageServer::Protocol::Interface::WorkspaceSymbol

A special workspace symbol that supports locations without a range

Attributes

attributes[R]

Public Class Methods

new(name:, kind:, tags: nil, container_name: nil, location:, data: nil) click to toggle source
# File lib/language_server/protocol/interface/workspace_symbol.rb, line 8
def initialize(name:, kind:, tags: nil, container_name: nil, location:, data: nil)
  @attributes = {}

  @attributes[:name] = name
  @attributes[:kind] = kind
  @attributes[:tags] = tags if tags
  @attributes[:containerName] = container_name if container_name
  @attributes[:location] = location
  @attributes[:data] = data if data

  @attributes.freeze
end

Public Instance Methods

container_name() click to toggle source

The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can’t be used to re-infer a hierarchy for the document symbols.

@return [string]

# File lib/language_server/protocol/interface/workspace_symbol.rb, line 52
def container_name
  attributes.fetch(:containerName)
end
data() click to toggle source

A data entry field that is preserved on a workspace symbol between a workspace symbol request and a workspace symbol resolve request.

@return [LSPAny]

# File lib/language_server/protocol/interface/workspace_symbol.rb, line 73
def data
  attributes.fetch(:data)
end
kind() click to toggle source

The kind of this symbol.

@return [SymbolKind]

# File lib/language_server/protocol/interface/workspace_symbol.rb, line 33
def kind
  attributes.fetch(:kind)
end
location() click to toggle source

The location of this symbol. Whether a server is allowed to return a location without a range depends on the client capability ‘workspace.symbol.resolveSupport`.

See also ‘SymbolInformation.location`.

@return [Location | { uri: string; }]

# File lib/language_server/protocol/interface/workspace_symbol.rb, line 64
def location
  attributes.fetch(:location)
end
name() click to toggle source

The name of this symbol.

@return [string]

# File lib/language_server/protocol/interface/workspace_symbol.rb, line 25
def name
  attributes.fetch(:name)
end
tags() click to toggle source

Tags for this completion item.

@return [1

# File lib/language_server/protocol/interface/workspace_symbol.rb, line 41
def tags
  attributes.fetch(:tags)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/workspace_symbol.rb, line 79
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/workspace_symbol.rb, line 83
def to_json(*args)
  to_hash.to_json(*args)
end