vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.79k stars 390 forks source link

feat(vscode): add empty pattern to codeblock attributes scope #4590

Closed KermanX closed 2 months ago

KermanX commented 2 months ago

Motivation: https://github.com/slidevjs/slidev/pull/1743 needs to inject to fenced_code.block.language.attributes.markdown to support highlighting special code block attributes like

Due to https://github.com/microsoft/vscode/issues/221682, grammar can't be injected into scopes without patterns and begin/end. However, only code blocks defined in VSCode's Markdown grammar file can be overridden by injecting the same code block rules with the desired patterns: [] into text.html.markdown (which has been done in this commit), so it seems that the only way to support Vue's code block is adding patterns: [] to Vue's grammar file.