sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
76.8k stars 3.98k forks source link

Svelte 5: Whitespace problem in typed parameters to snippets #11478

Closed ciscoheat closed 5 days ago

ciscoheat commented 1 week ago

Describe the bug

When adding a type to a parameter, there cannot be a whitespace after the parameter name.

snippet-param

Remove the whitespace before the colon to remove the error.

Reproduction

https://github.com/ciscoheat/s5-snippets-ws

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 42.49 GB / 63.93 GB
  Binaries:
    Node: 21.4.0 - C:\Program Files\nodejs\node.EXE       
    Yarn: 1.22.21 - ~\AppData\Local\pnpm\yarn.CMD
    npm: 9.3.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.0.6 - ~\AppData\Local\pnpm\pnpm.CMD
    bun: 1.0.32 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    svelte: ^5.0.0-next.1 => 5.0.0-next.123

Severity

annoyance

paoloricciuti commented 1 week ago

Uh this might be just a language server bug because the ast seem to already parse the types correctly

paoloricciuti commented 1 week ago
image

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAEy2MS26EQAwFr-I4mxkJwh4RlFwhW8yCj5npCOxWt5koavXdI8IsX71SJVzcyhHrLqEMG2ONn95jgfbrjxEfvBpjgVH3MB2kiVNw3mAd5PZOaJGwbaoTtiQkzUtZwhdv-mCwO8PP3RlHP0wMIy8aTjrpqgKmEE6TQ9AAZdmSpNcozns2WFQvxtGghmjBya3rr5mErBl3M5U2He_btzq5EBZAeM1N9fxIUvUMZZL0EVhmDv_NjnA4_ZGwv2YscNPZLY5nrC3snPv8B8k04lgaAQAA