Class: SyntaxTree::LanguageServer::InlayHints
- Inherits:
-
Visitor
- Object
- BasicVisitor
- Visitor
- SyntaxTree::LanguageServer::InlayHints
- Defined in:
- lib/syntax_tree/language_server.rb
Overview
This class provides inlay hints for the language server. For more information, see the spec here: github.com/microsoft/language-server-protocol/issues/956.
Defined Under Namespace
Classes: Hint
Instance Attribute Summary collapse
-
#hints ⇒ Object
readonly
Returns the value of attribute hints.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Instance Method Summary collapse
-
#initialize ⇒ InlayHints
constructor
A new instance of InlayHints.
- #visit(node) ⇒ Object
Methods inherited from BasicVisitor
valid_visit_methods, #visit_all, #visit_child_nodes, visit_method, visit_methods
Constructor Details
#initialize ⇒ InlayHints
Returns a new instance of InlayHints.
43 44 45 46 |
# File 'lib/syntax_tree/language_server.rb', line 43 def initialize @stack = [] @hints = [] end |
Instance Attribute Details
#hints ⇒ Object (readonly)
Returns the value of attribute hints.
41 42 43 |
# File 'lib/syntax_tree/language_server.rb', line 41 def hints @hints end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
41 42 43 |
# File 'lib/syntax_tree/language_server.rb', line 41 def stack @stack end |
Instance Method Details
#visit(node) ⇒ Object
48 49 50 51 52 53 |
# File 'lib/syntax_tree/language_server.rb', line 48 def visit(node) stack << node result = super stack.pop result end |