fix(highlight): highlight Svelte components (#3487)
* fix(highlight): highlight Svelte components `.svelte` had no entry in the extension table, so `highlightCode` fell through to one unstyled token per line. That is the same table the file pane, the diff tokens, markdown fences and the web editor all resolve through, so a component rendered as plain text everywhere in the app. Register `@replit/codemirror-lang-svelte`. Its `svelteLanguage` already wires the mixed parsing for the `<script>` and `<style>` blocks, so the script gets JS/TS roles, the style block gets CSS roles, and the template gets tag, directive and mustache roles. It comes from the same publisher as the `@replit/codemirror-lang-csharp` entry already in this package, and only the grammar itself is declared: its CodeMirror peers resolve the same way the C# grammar's peers already do. * test(server): cover Svelte diff highlighting The review surface in the issue is the diff, and the daemon is what tokenizes it (`diff-highlighter.ts` calls `highlightCode`), so the regression belongs here too: script, template block and markup roles on a `.svelte` hunk.
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
"@lezer/yaml": "^1.0.4",
|
||||
"@replit/codemirror-lang-csharp": "^6.2.0",
|
||||
"@replit/codemirror-lang-nix": "^6.0.1",
|
||||
"@replit/codemirror-lang-svelte": "^6.0.0",
|
||||
"lezer-elixir": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user