Skip to content

export let x: Type and type declaration without ending semicolon last in script block breaks syntax highlighting #1970

Closed
@poppa

Description

@poppa

Describe the bug

When running Typescript mode and you have either an export let varName: Type, or type Type = type without a line-ending semicolon last in a script block, the syntax highlighting breaks.

The problem with type declarations I've seen for ages, but the problem with component properties arrived yesterday after updating VS Code.

I think the screenshots are quite explanatory.

Syntax highlight breaks after ZeRow

export-let

Syntax highlighting breaks after the ending curly brace for type declaration Test

type

Syntax highlight works when ending type declaration with a semicolon

type-with-semi

Syntax highlighting works when ending property declaration with semicolon

export-let-with-semi

Syntax highlighting works when ending script block with some other statement or expression

other-expr

Reproduction

This simple snippet is sufficient to to reproduce the bug.

<script lang="ts">
export let test: any
</script>

Expected behaviour

I expect the ending </script> tag to be correctly highlighted

System Info

  • IDE: VS Code

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions