TypeScript keywords #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
I am looking to contribute a minor update to the parser in the way it handles TypeScript keywords - specifically, certain TypeScript keywords like
satisfies(https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html) are not being correctly formatted as keywords.To include this in the grammar, would I simply need to update the
javascript.grammarfile?Also, in case Marijn Haverbeke is reading this, my sincerest gratitude for all your tireless efforts!
Unfortunately, the TypeScript project doesn't publish a complete description of all the extensions they make to the grammar, so the more obscure ones I tend to find out about only through issue reports like this. Attached patch adds the
satisfiesoperator.I just updated Chrome DevTools to @lezer/javascript 1.5.0 locally and tried both the example from this post
and the example from the TypeScript documentation
but in both cases
satisfiesdoesn't seem to be decorated as keyword.I didn't dig deeper yet, though.
I forgot to add highlighting tags to the new token. Should be fixed now.
Thank you for this latest update @marijnh , it seems like it has improved the highlighting for all TypeScript keywords. I'm using CodeMirror 6 to build a free TypeScript reference guide and have found it to be marvelously easy to add things like inline errors and highlighting. Still a work in progress but hopefully you can see some Codemirror 6 features in the wild 😃
Thanks Marijn!