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

markdown.heading missing in VS Code theme #36

Closed
TomMoeras opened this issue Oct 11, 2023 · 3 comments · Fixed by #57
Closed

markdown.heading missing in VS Code theme #36

TomMoeras opened this issue Oct 11, 2023 · 3 comments · Fixed by #57

Comments

@TomMoeras
Copy link

The markdown.heading scope appears to be missing from the Flexoki-Dark-color-theme.json file. When using a markdown heading like # Heading, the heading is white.
markdown_heading_scope_missing1

I've manually added the markdown.heading scope to my JSON file. However, I've noticed that the "#" still remains in the default white color instead of the heading color.
markdown_heading_scope_missing2

@Railly
Copy link
Contributor

Railly commented Oct 11, 2023

I was using entity.name.section.markdown for matching that token. I can add markdown.heading, but can you show me your textmate scopes for both the "#" and the heading? Just like this:

image

@TomMoeras
Copy link
Author

Thank you for your response.

I noticed that the issue seemed specific to Quarto markdown files. After experimenting, I was able to get the desired formatting by adding the following to the theme's JSON:

{
  "scope": "markup.heading",
  "settings": {
    "fontStyle": "bold",
    "foreground": "#D0A215"
  }
},
{
  "scope": [
    "punctuation.definition.heading"
  ],
  "settings": {
    "foreground": "#CE5D97"
  }
}

Additionally, defining both entity.name.section and entity.name.section.markdown separately in the theme configuration also seemed to address the issue.

To be honest, theme development and TextMate scopes are not my expertise. However, I found it interesting that Quarto(md)-specific elements, although not explicitly defined, still get formatted correctly by using .markdown scopes. It makes me wonder how the default theme handles this as there it is rendered as expected by using .markdown scopes.

As for the textmate scopes you asked for:

For the # character:
quarto_theme_md_issue

For the heading:
quarto_theme_md_issue2

@Railly
Copy link
Contributor

Railly commented Oct 12, 2023

It makes me wonder how the default theme handles this as there it is rendered as expected by using .markdown scopes

Yup, you nailed it. I was working on a new theme generator for VSCode yesterday and I can confirm the better defaults you have, the less specificity you need.

I reduced the amount of lines from 1200 to 560 approximately, and obtained a similar, or even a better result.

I'll be releasing an update on this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants