-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Autocompletion inside on:click arrowfunction #89
Comments
Oh! this bugs me a lot before lol. I did try to fix it a few days ago and thought it was fixed. Turns out it is just because of html tag auto-close not working. And it got reintroduced after #79. |
Maybe we need a regex for that, checking something along the lines of "if tag open and |
@icebr9 you can disable tag auto close for now
|
@jasonlyu123 thanks! Doesn't bother me that much, just wanted to let you guys know that It is happening. Seems to be a very old bug because present in community's version of |
The issue behind this is that the language server uses vscode's HTML language service to provide HTML features. Problem is, the HTML parser would take the arrow as the end of a tag svelte: {#each items as item}
<Foo on:click={() => bars(item.id)} />
{/each} html: {#each items as item}
<Foo on:click={() => bars(item.id)} />
{/each} So everything behind arrow will be treated as text content. That means after that emmet will started to bother you and property auto complete won't work. It could be handle by preprocessing everything in the For now, to properly address it would be using the svelte parser to get the AST and preprocess using it, but it might have some performance issues. On the other hand, using a big regex to handle it would be a solution but it will have some edge-case to be handled. Also, there is already a lot of regex to match tags, maybe at some point, it might really be faster to do preprocess and parse AST. |
There is another problem with using the svelte parser/compiler: If you get into this situation, you are in an incomplete state, so the parser/compiler will throw an error. To address this, something like sveltejs/svelte#4818 needs to be done. For now I think we need some quickfix like "check last 10-15 characters and see if there is a |
Describe the bug
When making event handler (i.e. on:click), the arrow function autocompletion inside seems to be malfunctioning.
To Reproduce
Try typing:
when you do
>
it autocomplete the div inside the arrow function, see gif below:Expected behavior
No autocompletion, let me do the arrow function.
Screenshots
Link to imgur gif
System (please complete the following information):
The text was updated successfully, but these errors were encountered: