-
-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I have a component where i define the $$Props type like this
<script lang="ts">
export let text: string;
type $$Props = {
text: string;
"--bg": string;
};
</script>
<p>{text}</p>
<style>
p {
background-color: var(--bg);
}
</style>this is to provide autocompletion for the --bg css variable in the parent component. This actually works but there are a couple of problems:
- The autocomplete it's actually there but when you press enter it autocompletes with the quotes around giving you errors:

- When you remove the strings it still gives you an error because it's not actually a props being passed (this is probably because it actually get's de-sugared to a div with a style props around the component

Reproduction
- clone https://github.com/paoloricciuti/typescript-styleprops-bug
- observe that the Child component used in +page.svelte errors out
Expected behaviour
- The autocomplete should not include the strings when a dash is present in the name.
- The props should also be recognized as a correct prop passed to the component.
System Info
- OS: Windows
- IDE: VSCode
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
I guess this is for the Svelte for VSCode extension but it could also be a language-server issue.
gzimbron
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working