Add ParseTreeVisitor to Echo tag

This fixes theme-check#218, wherein variables used in echo tags are not
considered used by the linter. It is because our visitor doesn't see the
:variable_lookup's in the echo tag since the children array is empty.
But this array is empty because it is swallowed by the @variable.
This commit is contained in:
Charles-P. Clermont
2021-03-22 14:19:10 -04:00
parent 4fba61a802
commit c270a6f378
2 changed files with 15 additions and 0 deletions

View File

@@ -26,6 +26,13 @@ class ParseTreeVisitorTest < Minitest::Test
)
end
def test_echo
assert_equal(
["test"],
visit(%({% echo test %}))
)
end
def test_if_condition
assert_equal(
["test"],