Add YAML frontmatter syntax highlighting for .sudo.md files #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds YAML frontmatter syntax highlighting support to
.sudo.mdfiles, bringing them to parity with standard.mdfiles in VSCode.Problem
Previously, YAML frontmatter in
.sudo.mdfiles was rendered as plain text without any syntax highlighting, making it difficult to distinguish between keys, values, and different data types:In contrast, standard
.mdfiles have proper YAML frontmatter highlighting:Solution
Added frontmatter support to the TextMate grammar by:
frontmatterpattern that matches YAML blocks delimited by---at the beginning of filessource.yamlgrammar for consistent YAML syntax highlightingTechnical Implementation
The frontmatter pattern:
\Aanchor to match only at the very beginning of the file---or...delimiter on its own linesource.yamlfor consistency with standard markdown filesThis ensures that:
number:,status:) display in blue3,true,false) display in green"blocked") display in brown/orange---) display as punctuationExample
All YAML elements in the frontmatter now have proper syntax highlighting matching standard markdown behavior.
Testing
Fixes issue regarding frontmatter YAML syntax highlighting in
.sudo.mdfiles.Original prompt
Fixes #37
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.