class LanguageServer::Protocol::Interface::InlayHint

Inlay hint information.

Attributes

attributes[R]

Public Class Methods

new(position:, label:, kind: nil, text_edits: nil, tooltip: nil, padding_left: nil, padding_right: nil, data: nil) click to toggle source
# File lib/language_server/protocol/interface/inlay_hint.rb, line 8
def initialize(position:, label:, kind: nil, text_edits: nil, tooltip: nil, padding_left: nil, padding_right: nil, data: nil)
  @attributes = {}

  @attributes[:position] = position
  @attributes[:label] = label
  @attributes[:kind] = kind if kind
  @attributes[:textEdits] = text_edits if text_edits
  @attributes[:tooltip] = tooltip if tooltip
  @attributes[:paddingLeft] = padding_left if padding_left
  @attributes[:paddingRight] = padding_right if padding_right
  @attributes[:data] = data if data

  @attributes.freeze
end

Public Instance Methods

data() click to toggle source

A data entry field that is preserved on an inlay hint between a ‘textDocument/inlayHint` and a `inlayHint/resolve` request.

@return [LSPAny]

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

The kind of this hint. Can be omitted in which case the client should fall back to a reasonable default.

@return [InlayHintKind]

# File lib/language_server/protocol/interface/inlay_hint.rb, line 47
def kind
  attributes.fetch(:kind)
end
label() click to toggle source

The label of this hint. A human readable string or an array of InlayHintLabelPart label parts.

Note that neither the string nor the label part can be empty.

@return [string | InlayHintLabelPart

# File lib/language_server/protocol/interface/inlay_hint.rb, line 38
def label
  attributes.fetch(:label)
end
padding_left() click to toggle source

Render padding before the hint.

Note: Padding should use the editor’s background color, not the background color of the hint itself. That means padding can be used to visually align/separate an inlay hint.

@return [boolean]

# File lib/language_server/protocol/interface/inlay_hint.rb, line 85
def padding_left
  attributes.fetch(:paddingLeft)
end
padding_right() click to toggle source

Render padding after the hint.

Note: Padding should use the editor’s background color, not the background color of the hint itself. That means padding can be used to visually align/separate an inlay hint.

@return [boolean]

# File lib/language_server/protocol/interface/inlay_hint.rb, line 97
def padding_right
  attributes.fetch(:paddingRight)
end
position() click to toggle source

The position of this hint.

@return [Position]

# File lib/language_server/protocol/interface/inlay_hint.rb, line 27
def position
  attributes.fetch(:position)
end
text_edits() click to toggle source

Optional text edits that are performed when accepting this inlay hint.

Note that edits are expected to change the document so that the inlay hint (or its nearest variant) is now part of the document and the inlay hint itself is now obsolete.

Depending on the client capability ‘inlayHint.resolveSupport` clients might resolve this property late using the resolve request.

@return [TextEdit

# File lib/language_server/protocol/interface/inlay_hint.rb, line 62
def text_edits
  attributes.fetch(:textEdits)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/inlay_hint.rb, line 112
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/inlay_hint.rb, line 116
def to_json(*args)
  to_hash.to_json(*args)
end
tooltip() click to toggle source

The tooltip text when you hover over this item.

Depending on the client capability ‘inlayHint.resolveSupport` clients might resolve this property late using the resolve request.

@return [string | MarkupContent]

# File lib/language_server/protocol/interface/inlay_hint.rb, line 73
def tooltip
  attributes.fetch(:tooltip)
end