Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
36 stars 3 forks source link

Are tag names supposed to be autocompleted? #70

Closed diegovogel closed 10 months ago

diegovogel commented 1 year ago

Describe the bug I don't know how this extension is supposed to work so this may not be a bug. When I start typing a tag name I would expect it to offer autocomplete suggestions and it never does, for tag names specifically. For example if I type in {{ par it won't suggest partial. But if I type in {{ partial: then it lists partials in my project. It would also be nice if it automatically closed the tag, e.g. added {{ /partial }} when I select an autocomplete option. I tried disabling all other extensions and restarting VC Code but that didn't make a difference.

image

Impacted Products Which Antlers Toolbox products does this bug apply to?

Versions and Other Plugins/Extensions v2.6.0

JohnathonKoster commented 1 year ago

At the start of a tag you can force the completions to appear by hitting the completion trigger (on Windows it is Ctrl + Space by default) and begin typing the tag names (will look into improving the some triggers) and begin typing:

image

Not all instances of the partial tag will always be closed, and there is no reliable way to do that without being frustrating for most users.

diegovogel commented 1 year ago

Thanks for the quick reply. I don't think I explained very well. I am getting suggestions, the problem is they don't include any Antlers tags. This happens whether I manually trigger it or it triggers automatically when I'm typing.

Screen Cast 2023-05-01 at 11 11 41 AM

Screen Cast 2023-05-01 at 11 14 26 AM

Also, if I understood that last part correctly then it should automatically close some tags, just not the partial tag. Is that right? It's not closing any tags for me, but I guess that's because the autocomplete isn't working.

JohnathonKoster commented 1 year ago

The extension will not auto-close any tags, by design.

I am not able to replicate the auto-complete behavior. If you trigger the manual completions trigger in an empty {{ }} does it display a list for you? If not, could you include your emmet/etc. configuration?

Thanks!

diegovogel commented 1 year ago

Here's what I get when I do that:

Screen Cast 2023-05-01 at 11 37 32 AM

Looks like it includes a lot of Statamic things (custom fields and such) but no tags.

I tried totally disabling Emmet just now but that didn't make a difference. Here's my configuration (apologies if there's a better way to share this).

image

image

image

JohnathonKoster commented 10 months ago

Closing issue as it hasn't been reproduced or seen activity in a while.

montemartin commented 2 weeks ago

@JohnathonKoster I've had this same issue frequently, but I've never been able to figure out any logic to when it fails to work. TBH I think VSCode just hates me because it only fails when I'm actually writing templates. Every time I try to debug it works fine. 🤷