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

numeric file size modifier scope #111

Open
keith-hall opened this issue May 31, 2018 · 2 comments
Open

numeric file size modifier scope #111

keith-hall opened this issue May 31, 2018 · 2 comments

Comments

@keith-hall
Copy link
Contributor

Environment

  • Sublime 3176
  • Monokai

Issue Description

Number modifiers are given a keyword.other scope, rather than something more appropriate.

Screenshots

image

Expected Behavior

the file size units modifier of the number is not a keyword, so it should receive a scope like storage.modifier.numeric.file-size instead of keyword.other, to be more consistent with other syntaxes

Code Samples

$file_size = 1024mb
@msftrncs
Copy link
Contributor

@keith-hall, I am not sure that storage.type is a great scope. Numbers already support a storage type modifier, so that would clash.

1Dkb
1.Dkb
1.E12kb
1.1Dkb
1.1E12kb
.1E+12Dkb
1Lkb
1.5Lpb
1.E12Lkb
1.14E12Lkb
.14Ltb
1E12Lkb

(note some of these fail to scope correctly in the current grammar)

In the current grammar, the D (for [decimal]) and the L (for [long]) are not separated from the number, but they are technically the storage type modifier. In PR #156 I have assigned them storage.modifier and have assigned the byte scale as constant.langauge

In a modified VS Code Monokai Dimmed this gives: (with keyword and constant comparison)

image

I suppose a possibility is that the byte scale could be a form of operator (its providing multiplication), but in a lot of themes, keyword.other and keyword.operator are the same.

@keith-hall
Copy link
Contributor Author

good point about color schemes, your solution works for me, thanks @msftrncs :)

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

No branches or pull requests

3 participants