Fix vscode javascript syntax highlighting for ?? operator (nullish coalescing) #6205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Fixes a bug
What is the current behavior?
See issue: #5587
What is the new behavior?
JS, TS, JSX, TSX files are syntax highlighted correctly even when the
??
operator is used.What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.
.js, .jsx, .ts, .tsx
files??
operator, keywords likeconst
are not correctly coloredNotes
tmLanguage
files that contained the stringlogical.[jt]s
that weren't test files, using add nullish coalescing support microsoft/TypeScript-TmLanguage#768 as a reference to update the patterns forkeyword.operator.logical.*
andternary-expression.begin
main.min.json
(used an online json minifier since the referenced https://github.com/codesandbox/extension-bundle-utils repo is inaccessible to me) and then bump all version numbers (I used repo-wide find/replace)Caveats
npm run update-grammars
to work. It seems the readme in https://github.com/codesandbox/codesandbox-client/tree/master/standalone-packages/vscode-extensions/out/extensions/typescript-basics/syntaxes is out of date, and maybe it has to do withbuild
being gitignored.main.min.json
. Would it make sense to un-minify this file & separate fields by newlines, for ease of review in the future?yarn lint-staged
crashed with OOM (this is probably due to the updates to the minified js files causing eslint to report tens of thousands of issues). If this is not a problem, would it make sense to exclude these from the precommit hook? (it seems reasonably straightforward to do this according to https://stackoverflow.com/questions/55457364/husky-lint-staged-is-it-possible-to-exclude-ignore-file).Checklist