marcoroth / stimulus-lsp

Intelligent Stimulus tooling for Visual Studio Code and Neovim
https://hotwire.io/ecosystem/tooling/stimulus-lsp
MIT License
225 stars 11 forks source link

Twig support #191

Open marcoroth opened 7 months ago

marcoroth commented 7 months ago

https://twig.symfony.com

jcsmithf22 commented 3 weeks ago

Has this been implemented? I am not getting autocomplete in my twig templates (symfony project)

marcoroth commented 3 weeks ago

Hey @jcsmithf22, sadly not quite yet, the current implementation only works on actual HTML tags.

So if you have regular HTML in Twig files it should work, but it doesn't work for Twig-specific syntax that might emit HTML.

marcoroth commented 3 weeks ago

This is similar for any other templating language. For ERB files in Rails projects it works for this for example:

<div data-controller="|">

But it doesn't work for something like:

<div>
  <%= tag.div(data: { controller: "|" }) %>
</div>
jcsmithf22 commented 3 weeks ago

That's interesting, I am not having any autocomplete in twig. Here are a couple screenshots. I think it may not be finding the automatically registered controllers in Symfony either.

This is in twig:

image

This is in html:

image image

This is in the controller:

image