Closed ayoubelmhamdi closed 1 year ago
You need to include the scanner file:
files = { 'src/parser.c' , 'src/scanner.cc'},
the error is gone, but there no highlighting
works on helix, try with the latest commit
yah it work, the problem is come from my colorscheme that not detected it, because it is detected by Playground plugins, i will try to override my theme or using some tree-sitter query to make the typst query understand by Any theme.
I previously did not close it because it showed not yet correct parsing of code.
Now I'm closing this issue because I think that would be better served by a separate issue if necessary.
i will try to override my theme or using some tree-sitter query to make the typst query understand by Any theme.
@ayoubelmhamdi Did you make the query that understands by nvim theme? Could you please open source the query file somewhere?
Now that nvim-treesitter more closely aligns with the helix highlight groups https://github.com/nvim-treesitter/nvim-treesitter/commit/1ae9b0e4558fe7868f8cda2db65239cfb14836d0, this works almost out of the box with neovim
However, as pointed out in the initial message in this issue, neovim assumes queries to be in queries/typst/{highlight,indent}.scm
rather than just queries/{highlights,indent}.scm
Since the helix workflow in the readme relies on symlinking these things anyway, would you be open to moving the files to make use with nvim easier. In my fork where I made this move, the installation is as easy as
Plug 'https://github.com/TheZoq2/tree-sitter-typst'
require'nvim-treesitter.install'.prefer_git = true
parser_config.typst = {
install_info = {
url = "https://github.com/frozolotl/tree-sitter-typst.git", -- local path or git repo
files = {"src/parser.c", "src/scanner.cc"},
},
filetype = "typst", -- if filetype does not match the parser name
}
Since the helix workflow in the readme relies on symlinking these things anyway, would you be open to moving the files to make use with nvim easier. In my fork where I made this move, the installation is as easy as
That sounds like a great idea! Since you already did the work, would you be willig to create a pull request?
Try to useit in neovim but not work
it is should be in the path like: