Skip to content

numeric file size modifier scope #111

Open

Description

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

Activity

  1. msftrncs commented on May 15, 2019

    @msftrncs
    Contributor

    Keith Hall (@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.

  2. keith-hall commented on May 17, 2019

    @keith-hall
    ContributorAuthor

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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions