sveltejs/language-tools

type declaration without ending semicolon last in script block breaks syntax highlighting (again)

Closed this issue · 1 comments

Describe the bug

I am experiencing the exact same symptoms from #1970

Inside my script tags, if the last line is a type declaration, it breaks syntax highlighting for the rest of the file if there is no semicolon.

Prior bug claimed this was fixed in vscode 1.78
I'm using vscode 1.92.0

This is my first svelte project, so I have no prior history to reference.

Reproduction

component.svelte

<script lang="ts">
  
  type $$Props = {}
</script>

<div>My component</div>
image

Expected behaviour

(but without the semicolon)
image

System Info

  • OS: M1 Max Macbook Pro OS 14.3
  • IDE: VSCode 1.92

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

This isn't a regression for #1970 but a duplicate of #1110. This is an upstream limitation in https://github.com/microsoft/TypeScript-TmLanguage. VSCode uses TextMate format for syntax highlight, but the format has capability limitations and will likely never be fixed in the upstream repo.