microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.65k stars 29.43k forks source link

feature request: optionally expose semantic tokens for markdown files, to enable customizing colors via `editor.semanticTokenColorCustomizations` (not just `editor.tokenColorCustomizations`) #214822

Closed yg-i closed 5 months ago

yg-i commented 5 months ago

Currently markdown files have rich language server support (via the built-in extension "Markdown Language Features"), but no semantic tokens have been made available for styling via decorations:

image

I'd like to request the ability to style e.g. code blocks and code spans via decorations, not just textmate scopes, since decorations are inherently more powerful.

Thanks for considering!

mjbvz commented 5 months ago

@aeschli Is this true:

I'd like to request the ability to style e.g. code blocks and code spans via decorations, not just textmate scopes, since decorations are inherently more powerful.

I don't see a compelling reason to add semantic highlighting for md since text mate already works fine

aeschli commented 5 months ago

As much as possible should be done with grammar based syntax highlighting. Semantic highlighting is delayed and intended as an addition to syntax highlighting for cases where a language service that has the full understanding of the project is required.

See https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide from more information.

mjbvz commented 5 months ago

Thanks @aeschli. Closing since it sounds like this is already supported for normal syntax highlighting