-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
C-bugCategory: This is a bugCategory: This is a bug
Description
Summary
In a <script lang="ts">
inside a .svelte
file, compound inline type definitions like Node[]
in the example below seem to break something in the grammar.

This manifests in both the function name not receiving syntax highlighting, but also broken matching on parens/brackets/curlies.
After a hx --grammar fetch
and hx --grammar build
# hx --health svelte
Configured language servers:
✓ svelteserver: /opt/homebrew/bin/svelteserver
Configured debug adapter: None
Configured formatter:
✓ /opt/homebrew/bin/prettier
Tree-sitter parser: ✓
Highlight queries: ✓
Textobject queries: ✘
Indent queries: ✓
This bug does not appear in regular .ts
files.
Reproduction Steps
I tried this:
hx
- Create a .svelte file with a typescript injection.
<script lang="ts">
let count = $state(0);
const doubled = $derived(count * 2);
function increment(): void {
count += 1;
}
</script>
<main>
<p>
The count is {count}
</p>
<p>
Doubled, the count is {doubled}
</p>
<button onclick={increment}>
Increment
</button>
</main>
- This renders nicely

- Modify increment function type
<script lang="ts">
let count = $state(0);
const doubled = $derived(count * 2);
function increment({messages}: {messages: string[]}): void {
messages.map(console.log)
count += 1;
}
</script>
<main>
<p>
The count is {count}
</p>
<p>
Doubled, the count is {doubled}
</p>
<button onclick={() => increment({messages:["hello"]})}>
Increment
</button>
</main>
- Rendering and parens matching broken

I expected this to happen:
Rendering and parens matching should still have worked.
Instead, this happened:
It did not work.
Helix log
~/.cache/helix/helix.log
2025-08-07T12:35:34.385 helix_view::document [ERROR] Formatter error: [error] Couldn't resolve parser "svelte".Looks relevant.
Platform
macOs
Terminal Emulator
ghostty
Installation Method
brew
Helix Version
helix 25.07.1 (a05c151)
SymphonySimper
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bugCategory: This is a bug