Open Dekker1 opened 2 years ago
For local development, you can just set it to the subfolder where your tree-sitter directory with standard tree-sitter layout is located. We have a work-around for this for tsx/typescript and ocaml parsers. See https://github.com/nvim-treesitter/nvim-treesitter/pull/2563#discussion_r812208864 as the vlang PR faced the same problem. We're open for PR that make this setting more expected/discoverable.
I was indeed using the local development directory as workaround.
location
was indeed the actual functionality that I was looking for. I was looking through the code trying to find something like it, but since I'm not an experienced LUA programmer I must have missed it.
It probably would be good to make this feature more visible. I'll see if I have some time to open a PR to add a sentence or two to the documentation.
Is your feature request related to a problem? Please describe.
I'm working on a language that includes a tree-sitter parser. Although it is great that this project can immediately provide language support in NVIM, it is a bit frustrating to install the tree-sitter language. Because the tree-sitter grammar is located in a subdirectory of the repository, using a configuration that I would expect to work gives a compilation error:
Configuration:
Error:
It would be great if there was some way to provide either the include path or the subdirectory in which the tree-sitter structure is located.
Describe the solution you'd like
An additional field in
install_info
that allows the user to specify a subdirectory of the repository in which the tree-sitter structure is located. The compilation should then be executed from this directory.Describe alternatives you've considered
files
path assuming a standard tree-sitter structure. (This makes an additional assumption and might require some path logic).url
field, like with Pythonpip
's installing from URL. (Would require more complex URL schemas).Additional context
I understand that this is maybe not the most common scenario and that most tree-sitter grammars are seperate from a language. However, for a developing language that uses the tree-sitter grammar internally, using only one repository that includes the grammar to keep it in sync seems logical to me.