Open nufue opened 3 months ago
Same problem is for {if} inside {define}
Same with printing.
An element of an array is indicated as "Print invalid type: array" in Inspection, as if I were trying to print the entire array.
A variable that is declared as default null is indicated as "Print invalid type: null", even though the printout occurs in n:ifset="" condition that rules out the value of null.
Also, the inspection for print invalid type is named "Tag var
content". There are two such entries in Inspections / Latte / Not allowed, one of them actually checks tag var content, the other checks invalid printing types.
This is obviously a minor misprint, copied value from an older inspection, still a bit confusing if you want to turn the broken printing detections off.
Describe the bug The detection of usage of variables created via
{var}
seems to be broken when usage occurs inside{foreach}
while the whole template is enclosed in{block}..{/block}
.Environment (please complete the following information):
To Reproduce
$level
in{var $level = 0}
is hinted as unused variable, which is not true, as it is used inside of{foreach}
. Also$level
in{php $level++}
is marked as Undefined variable.Code
Screenshots![image](https://github.com/mesour-intellij-plugins/latte-pro-issues/assets/8158773/305b4034-ae62-413a-9868-d77971f69a9f)
Additional context If I remove
{block content}
and{/block}
from the code, the variable is no longer marked as unused.