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

Test: Semantic Token Theming #85972

Closed
2 tasks done
aeschli opened this issue Dec 2, 2019 · 2 comments
Closed
2 tasks done

Test: Semantic Token Theming #85972

aeschli opened this issue Dec 2, 2019 · 2 comments
Labels
testplan-item themes Color theme issues
Milestone

Comments

@aeschli
Copy link
Contributor

aeschli commented Dec 2, 2019

Testing #77133

Complexity: 3


We have no language support yet, that implements the new semantic highlighting provider API, so this needs to be tested with a sample extension: https://github.com/microsoft/vscode/tree/master/extensions/vscode-colorize-tests

  • have your vscode repo on the latest and compiled

  • in vscode/extensions/vscode-colorize-tests/package.json, change to "engines": { "vscode": "1.41.0" }

  • copy or link vscode/extensions/vscode-colorize-tests to ~/.vscode-insiders/extensions

  • run code-insiders --enable-proposed-api=vscode.vscode-colorize-tests

  • create files that end with semantic-test.json

image

Every string literal in that file is considered a token. The value of the string describes the token classification: classes.static.declaration means that the token describes a static class declaration.

The first segment is the token type, the rest are token modifiers.

The types and modifiers supported by this test extension are:

tokenTypes = ['types', 'structs', 'classes', 'interfaces', 'enums', 'parameterTypes', 'functions', 'variables']; 
tokenModifiers = ['static', 'abstract', 'deprecated', 'declaration', 'documentation', 'member', 'async'];

In the settings you can define the rules how to style:

  "editor.tokenColorCustomizationsExperimental": {
    "classes": "#00b0b0",
    "interfaces": "#845faf",
    "functions": "#ff00ff",

    "*.declaration": {
      "fontStyle": "underline"
    },
    "*.declaration.member": {
      "fontStyle": "italic bold",
    }
  }
}

Valid font styles are: italic, underline, bold

Test:

  • that you can style the tokens in the settings JSON: set foreground, or foreground and font styles.
  • use the * syntax to style all tokens with a/some modifier(s)
  • test that when multiple rules apply to a token, the styles are merged. In case of conflict (e.g. on foreground), the more matching rule segments will win, or, if equal, the last rule defined wins.
  • test that the settings schema helps with creating and verifying rules.
  • test that if there is no style rule defined, the default color matches the color the theme gives to that token. E.g. parameterTypes is not styled in settings.json, so it default to how parameters types are colored. (create a typescript code sample to verify)
[
    "classes.declaration", 
        "functions.member.declaration",
            "parameterTypes.declaration",  "types", "parameterTypes.declaration", "types",
                "variables.declaration", "parameterNames",
        "functions.member.declaration",
    "interfaces.declaration",
        "functions.member.declaration"
            
]
@vscodebot vscodebot bot added the themes Color theme issues label Dec 2, 2019
@aeschli aeschli added this to the November 2019 milestone Dec 2, 2019
@sbatten
Copy link
Member

sbatten commented Dec 3, 2019

@aeschli please fill out test details

@aeschli
Copy link
Contributor Author

aeschli commented Dec 3, 2019

I removed one tester as this is work in progress.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testplan-item themes Color theme issues
Projects
None yet
Development

No branches or pull requests

7 participants