You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a lot of errors in the extension documentation, surrounding use of custom functions (TwingFunction). For example:
If you want to access the current context in your filter, set the needs_context option to true. Twing will pass the current context as the first argument to the filter call (or the second one if needs_environment is also set to true):
Of course, I am citing the filter documentation even though I am using functions because there are only examples and explanations given for filters and we are lead to believe they both operate alike.
First of all, passing options to the third parameter will do nothing whatsoever because the third parameter is some undocumented feature called acceptedArguments of type TwingCallableArgument[]. Whilst we're on the topic of this weird parameter, it's also a required field, so if you're coding in TypeScript, it's an error not to specify it, even though we can have no idea what it does.
Second, if one wants the environment, one must actually pass needs_template because there is no option called needs_environment.
This is all very misleading and confusing and it's unclear what is a documentation error or what might be an implementation error.
The text was updated successfully, but these errors were encountered:
There are a lot of errors in the extension documentation, surrounding use of custom functions (
TwingFunction
). For example:Of course, I am citing the filter documentation even though I am using functions because there are only examples and explanations given for filters and we are lead to believe they both operate alike.
First of all, passing options to the third parameter will do nothing whatsoever because the third parameter is some undocumented feature called acceptedArguments of type
TwingCallableArgument[]
. Whilst we're on the topic of this weird parameter, it's also a required field, so if you're coding in TypeScript, it's an error not to specify it, even though we can have no idea what it does.Second, if one wants the environment, one must actually pass
needs_template
because there is no option calledneeds_environment
.This is all very misleading and confusing and it's unclear what is a documentation error or what might be an implementation error.
The text was updated successfully, but these errors were encountered: