microsoft / TypeScript-TmLanguage

TextMate grammar files for TypeScript for VS Code, Sublime Text, and Atom.
MIT License
413 stars 126 forks source link

Suggestion: give `default` another token name when modifying the things being exported #996

Closed OzelotVanilla closed 11 months ago

OzelotVanilla commented 11 months ago

JavaScript and TypeScript Nightly version: 5.3.0-dev.20231015

Code

export default async function () { }

image

Currently default at this position is assigned keyword.control.default, while it is overlapping with the default in the switch statement.

To make it clearer, it might be better to assign it with something like storage.modifier.default like the async.

OzelotVanilla commented 11 months ago

I discovered that all control statement keyword like break or continue shares the scope keyword.control.loop, and keyword.control.default seems only to be used in export or import statement. So this question could be solved by:

Simply set keyword.control.default's value as the modifier, since the default keyword in loop uses another scope.