class LanguageServer::Protocol::Interface::CompletionItemLabelDetails

Additional details for a completion item label.

Attributes

attributes[R]

Public Class Methods

new(detail: nil, description: nil) click to toggle source
# File lib/language_server/protocol/interface/completion_item_label_details.rb, line 8
def initialize(detail: nil, description: nil)
  @attributes = {}

  @attributes[:detail] = detail if detail
  @attributes[:description] = description if description

  @attributes.freeze
end

Public Instance Methods

description() click to toggle source

An optional string which is rendered less prominently after {@link CompletionItemLabelDetails.detail}. Should be used for fully qualified names or file path.

@return [string]

# File lib/language_server/protocol/interface/completion_item_label_details.rb, line 33
def description
  attributes.fetch(:description)
end
detail() click to toggle source

An optional string which is rendered less prominently directly after {@link CompletionItem.label label}, without any spacing. Should be used for function signatures or type annotations.

@return [string]

# File lib/language_server/protocol/interface/completion_item_label_details.rb, line 23
def detail
  attributes.fetch(:detail)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/completion_item_label_details.rb, line 39
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/completion_item_label_details.rb, line 43
def to_json(*args)
  to_hash.to_json(*args)
end