We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
py
python
This doesn't add Python syntax highlighting:
```py print() ```
But this does:
```python print() ```
While both work fine with Markdown tree-sitter.
Checked on Neovim and Helix.
The text was updated successfully, but these errors were encountered:
With Helix, this fixed the problem: helix-editor/helix#10785. But I have no idea what to do in Neovim/tree-sitter if anything can be done.
Sorry, something went wrong.
Instead of https://github.com/uben0/tree-sitter-typst/blob/master/queries/typst/injections.scm#L4-L6, try the following:
(raw_blck lang: (ident) @_lang (blob) @injection.content (#set-lang-from-info-string! @_lang))
It turns out that for Neovim, this exact code is a part of https://github.com/nvim-treesitter/nvim-treesitter. So I did:
diff --git a/queries/typst/injections.scm b/queries/typst/injections.scm index 344c6a30..bc75d2b2 100644 --- a/queries/typst/injections.scm +++ b/queries/typst/injections.scm @@ -2,5 +2,6 @@ (#set! injection.language "comment")) (raw_blck - (ident) @injection.language - (blob) @injection.content) + lang: (ident) @_lang + (blob) @injection.content + (#set-lang-from-info-string! @_lang))
And now it works! I will have to make 2 PRs, I guess.
Successfully merging a pull request may close this issue.
This doesn't add Python syntax highlighting:
But this does:
While both work fine with Markdown tree-sitter.
Checked on Neovim and Helix.
The text was updated successfully, but these errors were encountered: