Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More autocompletion #121

Open
wagenet opened this issue Mar 31, 2021 · 1 comment
Open

More autocompletion #121

wagenet opened this issue Mar 31, 2021 · 1 comment
Labels
question Further information is requested

Comments

@wagenet
Copy link
Contributor

wagenet commented Mar 31, 2021

Right now it doesn't appear that we autocomplete for @ arguments on components or named blocks.

@dfreeman dfreeman added the question Further information is requested label Apr 1, 2021
@dfreeman
Copy link
Member

dfreeman commented Apr 1, 2021

Our fundamental restriction right now is that @glimmer/syntax doesn't have an error-tolerant parsing option and will only provide an AST for a 100% valid template. Because of that, we can autocomplete for @args and named blocks, but only if you go out of your way to ensure your surrounding template is syntactically valid.

image

image

For named blocks especially, that's pretty much useless, as the only way to get completions is to make it self-closing, go back and trigger a suggestion, then un-self-close the block and add the closing tag.

Both for Glint itself and for other tools like template-lint it would be super helpful for @glimmer/syntax to have an error-tolerant mode that gave a best-effort parse tree. With that, we could better support these and a bunch of other completion scenarios with little to no change on this end.

I know others are interested in that, and I'm banging the drum—yesterday in #st-typescript for instance 😄. For now there are still a ton of other things to do in Glint proper, but if we reach a point of readiness here that this completion pain makes it to the top of the priority list and no one else has been able to make progress with the parser in the meantime, I may take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants