difftastic icon indicating copy to clipboard operation
difftastic copied to clipboard

Dynamic sublanguages (injections)

Open arbrauns opened this issue 1 year ago • 0 comments

Some languages support arbitrary sublanguages inside tagged code blocks, for example some python code inside this Markdown text:

print("Hello world!")

It would be great if difft supported such tags and used the correct sublanguage parser for the code blocks. My specific usecase is Typst, which has the same code block syntax as Markdown but also a lot more features that make a tree-sitter parser very useful.

There seems to be a (semi-?)standard way of specifying these sublanguage blocks, injection queries.

arbrauns avatar May 17 '24 11:05 arbrauns