-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Improve Markdown syntax highlighting #25330
base: main
Are you sure you want to change the base?
Conversation
Release Notes: - Added syntax scopes to themes Supports: - [Improve CSS syntax highlighting](#25326) - [Improve Go syntax highlighting](#25327) - [Improve Markdown syntax highlighting](#25330) Changes: - Adds highlighting rules for the following new scopes, using theme colors: - `heading` - `namespace` - `selector` - `strikethrough` - `unit` - Renames scopes that are no longer used in `zed/crates/languages/src` or `zed/extensions` to their new names: - `punctuation.list_marker` -> `punctuation.markup` - `link_text` -> `link` - `link_uri` -> `link.url`, as defined in the [gitcommit grammar](https://github.com/zed-industries/zed/blob/dff47a843695d03160680502e6d94634e376698e/crates/languages/src/gitcommit/highlights.scm#L5) - `text.literal` -> `raw`
(link_text) @link_text | ||
(link_label) @link_text | ||
(link_destination) @link_uri | ||
(emphasis) @markup.emphasis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These selectors aren't going in the right direction.
We do partial matching on selectors, so we want them to go from less specific -> more specific.
So for this one it should be @emphasis.markup
.
This would allow for it to be styled just by emphasis
, but overridden by emphasis.markup
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some reservations about the breaking changes (the selector renames) to the themes in this PR, as it will break downstream user themes.
It would be great it if we could make the improvements without including the breaking changes so that we can deal with them separately.
Should I prepend original selectors, and create a new PR to deprecate them in the future? In this PR we'd have: |
I have some ideas for how we can handle the breaking change, but for now I would just like for this PR to make the improvements that don't require renaming the selectors. Once those are in place then we can merge the additive/backwards-compatible changes and deal with the breaking changes separately. |
Release Notes:
Changes to highlights:
Changes to include the
markup
scope, conforming to Neovim, VS Code, Atom, and Zed itself.paragraph
,indented_code_block
,pipe_table
:text
# Heading
:title
->heading.markup
-
,1.
,>
,|
:punctuation.markup
```
:punctuation.embedded.markup
[1]: url.com
,[link](url.com)
:link.markup
url.com
:link_uri
->link.uri.markup
*italic*
:emphasis
->emphasis.markup
**bold**
:emphasis.strong
->markup.emphasis.strong.markup
`raw`
:text.literal
->raw.markup
~~strikethrough~~
:strikethrough.markup
Changes to themes:
Add highlighting rules for the following new scopes, using theme colors:
heading
strikethrough
Rename scopes that are no longer used in
zed/crates/languages/src
orzed/extensions
to their new names:punctuation.list_marker
->punctuation.markup
link_text
->link
link_uri
,link.url
->link.uri
text.literal
->raw