Class: ThemeCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::ScopeVisitor
- Inherits:
-
Object
- Object
- ThemeCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::ScopeVisitor
- Defined in:
- lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb
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.
10 11 12 13 14 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 10 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.
8 9 10 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 8 def current_scope @current_scope end |
#global_scope ⇒ Object (readonly)
Returns the value of attribute global_scope.
8 9 10 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 8 def global_scope @global_scope end |
Instance Method Details
#visit_template(template) ⇒ Object
16 17 18 19 20 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb', line 16 def visit_template(template) return unless template visit(liquid_node(template), global_scope) end |