Add support for html_cva()
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3580788. --> Reported by: [thamas](https://www.drupal.org/user/53339) Related to !8 >>> <h3 id="version">Version</h3> <ul> <li>Drupal version: 11.3.5 </li> <li>Twig version: 3.4</li> </ul> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The <code>html_cva</code> function was added in Twig 3.12, and the CVA module makes it available in Drupal. But SDC Devel marks <code>html_cva</code> as "Unknown Twig function". </p> <p>Also, <code>html_cva</code> needs to use <code>apply()</code>. But SDC Devel marks it as an error: "Direct method call are forbidden."</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Use <code>html_cva</code> in an SDC. Eg.</p> <pre>{% set section =<br>&nbsp; html_cva(<br>&nbsp;&nbsp;&nbsp; base: width == 'full' ? '' : 'px-5 lg:px-8',<br>&nbsp;&nbsp;&nbsp; variants: {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theme: {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dark: 'dark bg-theme-primary text-white',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; light: 'light bg-neutral-light text-theme-primary'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; )<br>%}<br><br>{% set attributes =<br>&nbsp; attributes.addClass(<br>&nbsp;&nbsp;&nbsp; [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; section.apply({<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theme<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })<br>&nbsp;&nbsp;&nbsp; ]<br>&nbsp; )<br>%}<br><br>&lt;div {{ attributes }}&gt;<br>&nbsp; {{ section_content }}<br>&lt;/div&gt;</pre><p>Then check the component with SDC Devel. It will return the problems mentioned above.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Instead of reporting the use of <code>html_cva</code> as an error, check if it is used correctly.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>?</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>None.</p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>?</p> <h3 id="summary-api-changes">API changes</h3> <p>?</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>?</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>?</p>
issue