Open acao opened 1 year ago
@AaronMoat for any issues related to markdown, it all traces back to this fix we need to make
I'm pretty sure with tweaking of these begin
and end
statements this would work, and the same would follow for each language (php, python, scala, etc)
{
"fileTypes": [],
"scopeName": "markdown.graphql.codeblock",
"injectionSelector": "L:markup.fenced_code.block.markdown",
"patterns": [
{
"contentName": "meta.embedded.block.graphql",
"begin": "```(gql|graphql)?$",
"end": "```",
"patterns": [{ "include": "source.graphql" }]
},
{
"contentName": "meta.embedded.block.js",
"begin": "```(js|ts|jsx|tsx|svelte|vue)",
"end": "```",
"patterns": [{ "include": "source.graphql.js" }]
}
]
}
microsoft LSP spec calls this "embedded language" behavior, not to be confused with actual embedded languages 😆 , this is three or four times embedded 😆
Current Behavior
Currently, we have a markdown implementation that applies it's own logic for detecting graphql tags inside markdown blocks.
In LSP terms, that is a three times embedded language, haha! Vue and Svelte, markdown, all are examples of languages that embeds js/ts, which users expect to highlight embedded markdown for.
Expected Behaviour
Any improvements to the javascript implementation should happen for markdown. We just need to tweak the grammar json files to do so.