vim-svelte-plugin icon indicating copy to clipboard operation
vim-svelte-plugin copied to clipboard

Syntax highlighting inside <script lang="ts"> sometimes breaks with template strings

Open Theo-Steiner opened this issue 3 years ago • 1 comments

Hey there, thank you for maintaining this plugin! The below code seems to break syntax highlighting in everything following the closing curly braces.

<script lang="ts">
const obj = {
    err: new Error(`${templateString}`)
};
</script>

It seems that it has to be both inside an object and passed as the constructor to an object for the highlighting to break. スクリーンショット 2022-04-05 12 37 32

Theo-Steiner avatar Apr 05 '22 03:04 Theo-Steiner

Hi there. Thanks for your feedback. Actually, it seems to be a bug of TypeScript syntax runtime/syntax/typescriptcommon because I can reproduce it with a .ts file (set filetype=typescript).

Anyway, I fixed it by adding a syntax patch from our side: https://github.com/leafOfTree/vim-svelte-plugin/commit/cee02ddf99afe267ab515e53a1788050861cdd97 Please update this plugin and check if it works

Screen Shot 2022-04-06 at 11 33 12 AM .

leafOfTree avatar Apr 06 '22 03:04 leafOfTree

I'm closing it. Feel free to reopen it if necessary.

leafOfTree avatar Sep 25 '23 04:09 leafOfTree