Closed AntonPieper closed 1 year ago
The Gradle modules for the grammars are almost identical (just some minor differences in CMakeLists and the Java binding class). Therefore,
DynamicModulePlugin
using the grammars.json
file (learn more).build.gradle.kts
.The generated modules are located in rootDir/grammar-modules
directory.
To add a new grammar :
grammars
directory. You can add a submodule with the following command :
git submodule add <remote_url> grammars/<language_name>
language_name
must be the simple name of the language (i.e without the tree-sitter-
prefix). This name is used to generate the shared library and the Gradle module. For example, if the language_name
is abc
:
tree-sitter-abc
will be generated.libtree-sitter-abc.so
.grammars.json
file to include the newly added grammar.Also, make sure you read the prerequisites for building the project.
The README has been updated to include information about using/loading external grammars i.e. grammars that are not published to Maven Central along with this project.
More generally, how can I add another Tree-sitter grammar? Specifically I want to use GLSL. I see that you have forks of tree-sitter-java and the like, but there does not seem to be the source of the maven module. So how can I add my own grammar? Ideally without using maven