-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
What's the workflow for integrating a new language? #157
Comments
Have a look at https://github.com/ubolonton/tree-sitter-langs (sorry, that I can't provide more detailed explanations. Thought you would appreciate a quick feedback) |
I think there's some info within some issues:
The first one listed wasn't quite up to date at the time I worked on something, but it had important background. The second one has some of the extra bits that needed tweaking for my attempt. I don't know what the current state of things is. |
Thanks everyone, I'll try to put the puzzle together. |
I'm still reasonably new to this, but here is what I've been doing. I assume you already have You will need to generate the shared library from the repo you linked either by compiling As an example, I've compiled a grammar with:
but I am primarily using the The Then you will need to add the language to
I don't know what mode you will be using but replace "r-mode" with the mode of interest. The "r" is for the name of the grammar which according to the grammar in the repo you linked is "r". You can find the name in I'm primarily testing a verilog grammar at the moment which uses the name "verilog" and generates a With this configuration you should be able to run Andrea provides a similar description here. Their instructions for using the At the moment, I'm using
You can replace all the verilog references with r-specific ones. I just re-read some of the highlighting docs here and it seems like one could also use |
After noodling on this for a few days, what worked for me was to model a script based on csharp-tree-sitter.el. I'll try to get indentation working next. Very happy that I don't have to write any regexs in emacs-lisp :) Thanks everyone, this pet project is coming together one bit at a time. |
@jthaman May be you know already, but FWIW, regarding indentation, there is this: https://codeberg.org/FelipeLema/tree-sitter-indent.el |
I found this grammar for the R language, but I can't tell how I would actually go about integrating it with emacs-tree-sitter. Any help appreciated.
The text was updated successfully, but these errors were encountered: