Sitelet https://github.com/primer/github-vscode-theme/issues/25
Skip to content

Adopt semantic highlighting #25

Description

@aeschli

Since 1.43, VSCode themes can take advantage of semantic highlighting.

Every theme controls whether semantic tokens are enabled. Only built-in themes have it enabled by default. It would be great if the GitHub themes enable it by default too.

To turn on semantic highlighting for a theme, all you have to do is put

"semanticHighlighting": true

in the theme's definition file.

With that, semantic tokens will come in from the languages servers and are rendered on top of the TextMate based highlighting. So far TypeScript supports semantic tokens but more languages are in the works (Java, C++, C#).

Semantic tokens have their own classification system and themes can also write rules against this classification system, but we have a default mapping from semantic tokens to common TextMate scopes. For most themes, no adoptions are needed if they cover the common TextMate scopes.

To try this out, just add

	"editor.semanticTokenColorCustomizations": {
		"[GitHub Dark]": {
			"enabled": true
		},
		"[GitHub Light]": {
			"enabled": true
		}
	},

to the user settings.

  • Open a TypeScript file, wait for the semantic tokens to come in
  • Use the Inspect Editor Tokens and Scopes tool to see the semantic tokens and how they are mapped.

Check out our Semantic Highlighting Wiki and the Semantic Highlighting Guide for more details and feel free to ping me in this issue if I can help.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions