language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Autocomplete {#snippet _} when within a Component

Open pauldemarco opened this issue 1 year ago • 1 comments

Description

Here is a Component Header that takes a snippet title as a prop:

// Header.svelte
let {title}: {title: Snippet} = $props();

It is used like:

<Header>
    {#snippet title()}
        ...
    {/snippet}
</Header>

Proposed solution

It would be nice if the {#snippet _} could autocomplete for all snippets that the Component takes:

<Header>
    {#snippet <Autocomplete shows all my snippet options>}
        ...
    {/snippet}
</Header>

Alternatives

No response

Additional Information, eg. Screenshots

No response

pauldemarco avatar Sep 12 '24 15:09 pauldemarco

There is autocomplete already but with a big caveat, it doesn't work when the name is empty because of https://github.com/sveltejs/language-tools/issues/1302#issuecomment-1002358234.

jasonlyu123 avatar Sep 13 '24 04:09 jasonlyu123