microsoft / microsoft/TypeScript-TmLanguage
Theming: Distinguish between `import` types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 471
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Description
In Atom, we can theme imports based on the type of thing being imported. As you can see below, import aliases/names are styled differently than the class Knex being imported. This has always been immensely handy for at a glance differentiation and validation of imports as well as for organizing imports.
Below is the same theme applied to VS Code, but without the ability to differentiate.
I believe this comes down to a lack of TextMate scope. Here are the available scopes for makeContext:
variable.other.readwrite.alias.ts
meta.import.ts
source.ts
And the available scopes for Knex:
variable.other.readwrite.alias.ts
meta.block.ts
meta.import.ts
source.ts
My ignorant suggestion: it would probably be enough to catch capital-cased aliases for adding an additional scope.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the TypeScript grammar rules involved in makeContext and compare the scopes shown for the import alias and Knex. Determine how imported names are currently classified and define the distinct scope needed for theming. Done means import aliases and imported classes can be styled differently, with the resulting scopes verified against the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100