st4143-4.2.0
·
2 commits
to master
since this release
Modern Svelte 5 template syntax
- Template expressions are parsed as TypeScript: typed arrow parameters
(e: Event) => ...,ascasts, and generic callsfn<Result>(value)highlight correctly. Plain JavaScript expressions scope exactly as before. (#48) - Each blocks understand TypeScript sources: only the block's own
asis treated as the Svelte keyword, so{#each items as Item[] as item}and{#each (items as Item[]) as item}both highlight correctly. (#48) {@render ...}tags are recognized, including optional chaining. (#49){@attach ...}attachments highlight in attribute position on elements and components. (#49){let ...}/{const ...}declaration tags (Svelte 5.56) parse as real declarations with destructuring and TypeScript annotations;{@const ...}gains the same binding handling. (#49){#snippet name(params)}scopes the name as a function definition (symbol-list navigable) and parses parameters as function parameters, including generics:{#snippet pair<T>(a: T, b: T)}. (#49)- The
genericsscript attribute is highlighted as a TypeScript type parameter list, includingconstmodifiers, constraints, and defaults. (#47) - Legacy special variables (
$$propsetc.) are no longer highlighted inside string literals. (#46)
Tested on Sublime Text builds 4143 through the latest dev build.