Skip to content

Allow tree-sitter library path to be configurable at runtime #36

Description

@bioball

Thanks for this library!

We're using java-tree-sitter as part of our CLI, which gets shipped as a jar to our users' machines. We'd like to be able to control exactly where the tree-sitter library lives, to prevent users from having to spawn Java with custom flags (e.g. -Djava.library.path).

We can do this if java-tree-sitter provided a way to specify the library path programmatically at runtime. Java 22's FFI API allows this (see java.lang.foreign.SymbolLookup#libraryLookup(java.nio.file.Path, java.lang.foreign.Arena)).

It'd be great if the java-tree-sitter library gave us a way to do this, too. It'd involve changing the logic here from being hard-coded.

For now, we plan on modifying TreeSitter.java and re-compiling it during our own build. For reference: apple/pkl-lsp#23

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions