sveltejs/language-tools

VSCode suggestions only shows the default value of a generic prop when one is supplied

HighFunctioningSociopathSH opened this issue · 1 comments

Describe the bug

When using a generic in a component, vscode suggestion list only shows the default value of the generic instead of what it extends.

Reproduction

Test.svelte

<script lang="ts" generics="Element extends keyof HTMLElementTagNameMap = 'div'">
  let { element, ...restProps }: { element?: Element } = $props();
</script>

+page.svelte

<script lang="ts">
  import Test from "$components/Test/Test.svelte";
</script>

<Test element=""></Test>

image

Expected behaviour

Here's what it's supposed to suggest:
Test.svelte

<script lang="ts" generics="Element extends keyof HTMLElementTagNameMap">
  let { element, ...restProps }: { element?: Element } = $props();
</script>

+page.svelte

<script lang="ts">
  import Test from "$components/Test/Test.svelte";
</script>

<Test element=""></Test>

When using the above code the following result is shown.
image

System Info

  • OS: Windows 11
  • IDE: VSCode
  • Svelte for VSCode extention: v108.4.0

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response