feat: highlight the TypeScript generics attribute on script tags #47
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
repos/svelte-sublime!47
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/generics-attribute"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
genericsattribute holds a TypeScript type parameter list. Previously it was only an HTML string; now the quoted value is parsed as TypeScript: parameter names,constmodifiers,extendsconstraints, and defaults, reusing the default TS package's type-expression contexts (verified present in ST 4143 through latest).The attribute is pushed rather than set, so it composes with a
langattribute on either side, and quote termination survives braces (generics="Item extends { text: string }") and string-literal type defaults.Addresses finding 4 of the syntax audit. Includes a review fix from gpt-5.6:
consttype parameters (generics="const T extends readonly string[]") scope as a modifier, not a parameter name.New syntax tests pass on ST builds 4143 and latest.