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

[themes] language specific tokenColors #97753

Closed
ghost opened this issue May 13, 2020 · 6 comments
Closed

[themes] language specific tokenColors #97753

ghost opened this issue May 13, 2020 · 6 comments
Assignees
Labels
feature-request Request for new features or functionality themes Color theme issues

Comments

@ghost
Copy link

ghost commented May 13, 2020

"configurationDefaults: { "[language]": { "editor.tokenColorCustomizations": { … }}} does not currently seem to do anything in package.json. I think it should—please allow it.

@aeschli
Copy link
Contributor

aeschli commented May 14, 2020

We don't support defining tokenColors by language, neither in themes nor in settings.
-> editor.tokenColorCustomizations can not be scoped by language.

Instead you have to write language specific rules as seen here: #20652 (comment)

@aeschli aeschli changed the title tokenColorCustomizations in extensions [themes] language specific tokenColors May 14, 2020
@aeschli aeschli added the themes Color theme issues label May 14, 2020
@aeschli aeschli added this to the Backlog Candidates milestone May 14, 2020
@aeschli aeschli added the feature-request Request for new features or functionality label May 14, 2020
@ghost
Copy link
Author

ghost commented May 14, 2020

We don't support defining tokenColors by language, neither in themes nor in settings.
-> editor.tokenColorCustomizations can not be scoped by language.

Instead you have to write language specific rules as seen here: #20652 (comment)

That still does not appear to work in package.json configurationDefaults. (The package in question https://marketplace.visualstudio.com/items?itemName=vomout.latex-syntax adds special syntax highlighting for certain LaTeX commands. Currently the user has to configure it instead of the package providing sane defaults. Ideally it would be based on semantic highlighting microsoft/language-server-protocol#18 latex-lsp/texlab#235 without any package—just the language server adding command-specific tags and the user configuring what they want to configure—but while waiting for that to get somewhere, TextMate regexp forest approaching SkyNet level consciousness is what we have.)

@aeschli
Copy link
Contributor

aeschli commented May 15, 2020

configurationDefaults is only allowed for language scoped settings ({ "[language]":...`).
I created #97895 to warn about this.

I understand the desire for a grammar author (or semantic token provider) to add colors and styles for new and non-standard tokens/scopes. But its impossible to pick colors and styles that work in all themes. Theming has to be the responsibility of the theme or the user.

I don't have a good solution in mind for this right now.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality themes Color theme issues
Projects
None yet
Development

No branches or pull requests

2 participants
@aeschli and others