Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uppercase variables are not highlighted in string templates #368

Closed
empz opened this issue Nov 23, 2016 · 6 comments
Closed

Uppercase variables are not highlighted in string templates #368

empz opened this issue Nov 23, 2016 · 6 comments

Comments

@empz
Copy link

empz commented Nov 23, 2016

TS and JS Grammar Extension version: 0.0.10 / latest

CREDIT_CARD should be colored the same as creditCard

image

let creditCard = 'cc';
const CREDIT_CARD = 'CC';

console.log(`Payment Type: ${creditCard}`);
console.log(`Payment Type: ${CREDIT_CARD}`);
@sheetalkamat
Copy link
Member

This should be moved to vscode because the language does scope out the constant correctly as:

Scope:                         source.ts
                               meta.var.expr.ts
                               meta.var-single-variable.expr.ts
                               meta.definition.variable.ts
                               variable.other.readwrite.ts

@aeschli
Copy link

aeschli commented Nov 24, 2016

@sheetalkamat There's no 'variable' in the scope, just 'constant.other'.
'constant' is used for all kind of things, such as literals ('constant.character', "constant.numeric', 'constant.language'), keywords ("constant.language"), in regex ('constant.other.character-class.regexp'), library class names ('support.constant')
that we all don't want to color like variables.

IMO this foremost a variable/property, and and constant is rather a secondary thing.
What about calling it 'variable.other.constant' ?

@sheetalkamat
Copy link
Member

@aeschli
Copy link

aeschli commented Dec 1, 2016

@sheetalkamat See https://www.sublimetext.com/docs/3/scope_naming.html for Sublimes recommendation on the usage of constant.* and variable..

'variable.other.constant' looks like a good match in our case.

@sheetalkamat
Copy link
Member

All right. Will update the scope to variable.other.constant then.

@aeschli
Copy link

aeschli commented Dec 7, 2016

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants