Closed dannypsnl closed 8 months ago
I wanted to set up language injections but didn't get around to it. When we have this set up we can get syntax highlighting for latex embedded in tree files
https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection https://github.com/DariusCorvus/tree-sitter-language-injection.nvim
Another similar issue was \proof got parsed as \p as above; this is a defined block, I'm not sure if tree-sitter is able to solve these situations.
Some of this is actually an issue with the queries which are part of the neovim plugin. Queries basically allow you to pattern match on a syntax tree, and the way I implemented them in forester.nvim is not particularly sophisticated yet (matching strings). The plan is to change the parser to use fields: https://tree-sitter.github.io/tree-sitter/creating-parsers#using-fields This will make pattern matching much easier and will alllow us to write better syntax highlighting
See the new screenshot, the parser isn't perfect yet but much better than before
The
\li
in math expression#{\lim_{x \to 0} f(x)}
also got highlighted as\li{...}
.