Class: PlatformosCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::ScopeVisitor
- Inherits:
-
Object
- Object
- PlatformosCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::ScopeVisitor
- Defined in:
- lib/platformos_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb
Constant Summary collapse
- SCOPE_UNAWARE_NODES =
%i[range range_lookup variable variable_lookup]
Instance Attribute Summary collapse
-
#current_scope ⇒ Object
readonly
Returns the value of attribute current_scope.
-
#global_scope ⇒ Object
readonly
Returns the value of attribute global_scope.
Instance Method Summary collapse
-
#initialize ⇒ ScopeVisitor
constructor
A new instance of ScopeVisitor.
- #visit_template(template) ⇒ Object
Constructor Details
#initialize ⇒ ScopeVisitor
Returns a new instance of ScopeVisitor.
12 13 14 15 16 |
# File 'lib/platformos_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 12 def initialize @node_handler = NodeHandler.new @global_scope = Scope.new({}) @current_scope = Scope.new({}) end |
Instance Attribute Details
#current_scope ⇒ Object (readonly)
Returns the value of attribute current_scope.
10 11 12 |
# File 'lib/platformos_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 10 def current_scope @current_scope end |
#global_scope ⇒ Object (readonly)
Returns the value of attribute global_scope.
10 11 12 |
# File 'lib/platformos_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 10 def global_scope @global_scope end |
Instance Method Details
#visit_template(template) ⇒ Object
18 19 20 21 22 |
# File 'lib/platformos_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 18 def visit_template(template) return unless template visit(liquid_node(template), global_scope) end |