Class: SyntaxTree::LanguageServer::InlayHints::Hint
- Inherits:
-
Object
- Object
- SyntaxTree::LanguageServer::InlayHints::Hint
- Defined in:
- lib/syntax_tree/language_server.rb
Overview
This represents a hint that is going to be displayed in the editor.
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(line:, character:, label:) ⇒ Hint
constructor
A new instance of Hint.
-
#to_json(*opts) ⇒ Object
This is the shape that the LSP expects.
Constructor Details
#initialize(line:, character:, label:) ⇒ Hint
Returns a new instance of Hint.
23 24 25 26 27 |
# File 'lib/syntax_tree/language_server.rb', line 23 def initialize(line:, character:, label:) @line = line @character = character @label = label end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
21 22 23 |
# File 'lib/syntax_tree/language_server.rb', line 21 def character @character end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
21 22 23 |
# File 'lib/syntax_tree/language_server.rb', line 21 def label @label end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
21 22 23 |
# File 'lib/syntax_tree/language_server.rb', line 21 def line @line end |
Instance Method Details
#to_json(*opts) ⇒ Object
This is the shape that the LSP expects.
30 31 32 33 34 35 36 37 38 |
# File 'lib/syntax_tree/language_server.rb', line 30 def to_json(*opts) { position: { line: line, character: character }, label: label }.to_json(*opts) end |