Class: PlatformosCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::Scope
- Inherits:
-
Struct
- Object
- Struct
- PlatformosCheck::LanguageServer::VariableLookupFinder::AssignmentsFinder::Scope
- Includes:
- TypeHelper
- Defined in:
- lib/platformos_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/platformos_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/platformos_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 29 30 31 32 33 34 35 |
# File 'lib/platformos_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 Tags::Function variable_name = tag.to variables[variable_name] = as_potential_lookup_function_result(tag) when Tags::Graphql variable_name = tag.to potential = as_potential_lookup_graphql(tag) variables[variable_name] = potential 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/platformos_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 |