microsoft / microsoft/TypeScript-TmLanguage

Can we have token for explicitly UPPER_CASED variable?

Open
#645 4 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Suggestion
Dominant language
TypeScript
Stars
471
Forks
149
PR merge metrics
No merged PRs in 30d

Description

TS and JS Grammar Extension version: 0.0.43 / latest

Code

// Please include a code snippet that demonstrates the issue
const UPPER_CASED_CONSTANTS_VARIABLE = 1;
const lower_cased_variable = 2;

#542
https://github.com/Microsoft/TypeScript-TmLanguage/commit/858d33f03943e4ec040e81cbabbc3f7892157c18

Prior to above fix, we can have UPPER_CASED variable as a constant so we can apply style for the uppercased constant differently, however, it's impossible now

Is it possible to have uppercased constant variable as another token? (e.g. variables.uppercased.constants, variable.uppercased.readwrite, ...)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TypeScript/JavaScript grammar extension context in the issue, then review #542 and commit 858d33f03943e4ec040e81cbabbc3f7892157c18 to understand the earlier tokenization change. Done means explicitly UPPER_CASED variables receive a distinct token scope while lower_cased variables and existing constant styling continue to classify correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.