Class: ThemeCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::Scope
- Inherits:
-
Struct
- Object
- Struct
- ThemeCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::Scope
- Includes:
- TypeHelper
- Defined in:
- lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#variables ⇒ Object
Returns the value of attribute variables.
Instance Method Summary collapse
Methods included from TypeHelper
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent
7 8 9 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb', line 7 def parent @parent end |
#variables ⇒ Object
Returns the value of attribute variables
7 8 9 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb', line 7 def variables @variables end |
Instance Method Details
#<<(node) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb', line 17 def <<(node) tag = node.value case tag when Liquid::Assign variable_name = tag.to variables[variable_name] = as_potential_lookup(tag.from.name) when Liquid::For, Liquid::TableRow variable_name = tag.variable_name variables[variable_name] = as_potential_lookup(tag.collection_name, ['first']) end end |
#new_child ⇒ Object
10 11 12 13 14 15 |
# File 'lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb', line 10 def new_child child_scope = dup child_scope.variables = variables.dup child_scope.parent = self child_scope end |