You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a snippet to "render" it to the DOM, you have to use {@render snippetname()} but simply using {snippetname} is valid svelte code and is not rejected by the compiler, this results in a bunch of javascript text instead of what the user actually wants (render the actual content).
Proposed solution
When there's type information available, check for if an identifier is a Snippet then upon asserting that it in fact is a snippet then warn the user and ask for them to instead use {@render <snippetName>()}
If the javascript output is intended (???), some sort of directive could be used to disable the warning for that instance. Not sure if this exists in the svelte LSP.
Alternatives
No response
Additional Information, eg. Screenshots
{#snippet something()}
<p>hello</p>
{/snippet}
<!-- the compiler is happy to render it without caring about whether it's a snippet or not --><div>{something}</div><!-- works as intended --><div>{@render something()}</div>
The text was updated successfully, but these errors were encountered:
Description
When using a snippet to "render" it to the DOM, you have to use
{@render snippetname()}
but simply using{snippetname}
is valid svelte code and is not rejected by the compiler, this results in a bunch of javascript text instead of what the user actually wants (render the actual content).Proposed solution
When there's type information available, check for if an identifier is a
Snippet
then upon asserting that it in fact is a snippet then warn the user and ask for them to instead use{@render <snippetName>()}
If the javascript output is intended (???), some sort of directive could be used to disable the warning for that instance. Not sure if this exists in the svelte LSP.
Alternatives
No response
Additional Information, eg. Screenshots
The text was updated successfully, but these errors were encountered: