Svelte Grammar is outdated for usage with Typescript #6215
Replies: 3 comments 2 replies
-
We can certainly switch to using your fork, but before we do, you might want to check on the progress of the https://github.com/sveltejs/svelte-atom grammar. We switched to it but had to revert as it broke the syntax highlighting of Svelte code between |
Beta Was this translation helpful? Give feedback.
-
Hey @lildude, Thanks for your quick response! I already went down this rabbit hole 😅 Have to compile the svelte-atom grammar to json to see what's still broken there.. |
Beta Was this translation helpful? Give feedback.
-
Ok I wrote a small PR that moves the Svelte Grammar definition to a maintained fork |
Beta Was this translation helpful? Give feedback.
-
Currently linguist uses https://github.com/umanghome/svelte-atom as grammar for svelte.
The issue is that Svelte has a somewhat new typescript directive
lang="ts"
in thescript
tag, which can create issues when rendering.See here https://github.com/radicle-dev/radicle-interface/blob/master/src/Authorship.svelte
The correct way to highlight this should be:
![localhost_3000_seeds_clients radicle xyz_rad_git_hnrkjajuucc6zp5eknt3s9xykqsrus44cjimy_tree_cfb1c5acd103772842bf6465359156476ce4e892_src_Authorship svelte](https://user-images.githubusercontent.com/7912302/208061351-3337897e-8073-4e82-89af-2e82a343cf8c.png)
I would suggest while waiting for the tree-sitter-svelte grammar to be solid, to have a new updated fork for the pretty lights svelte grammar.
I have updated the grammar on a fork of mine in the meantime https://github.com/sebastinez/svelte-atom/tree/sebastinez/add-lang-ts
Beta Was this translation helpful? Give feedback.
All reactions