New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thought on XDG convention #628
Comments
I like this idea, and we can leave @maxbrunsfeld Is the config file ever needed by the C library, or is it only used by the Rust CLI tool? If we need this from C, there is some code we could lift from libcork that both defines the XDG locations and implements a "look for a file in this list of paths" search. [docs] [code] |
(and if it's only needed from Rust there's the xdg crate) |
I’m +1 on this too, viz. how Emacs looks in |
Yeah, I'd be open to this. The config file is specific to the CLI, so there's not much cost to changing it. |
|
+1 to these! To recap, the "XDG way" would be something like this (in Bash-like syntax): Config file: Parsers: |
+1, but it's also nice to have an explicit environment variable (e.g. |
Note that the idea of a single "HOME" directory is somewhat incompatible with the XDG base directory setup, because in the XDG system you have two directories: one in A long time ago I implemented a patch for the Ruby Bundler tool that had some complicated fallback logic for this kind of thing: rubygems/bundler#6024 I propose the following for Tree Sitter:
So this will still be a breaking change, but you can choose to set Also, note that there is some debate on Mac and Windows as to whether the default XDG locations should be the same as on Linux or should use something more platform-specific. See https://stackoverflow.com/q/3373948/2954547 (Mac) and https://stackoverflow.com/q/43853548/2954547 (Windows). |
For anyone trying to move out It turns out tree-sitter cli supports Here is my config: export TREE_SITTER_DIR="${XDG_CONFIG_HOME}/tree-sitter" |
@maxbrunsfeld this issue was successfully resolved by awesome @dcreager rework of CLI with extraction of config loading logic to a separate crate. So this issue can be closed. |
tree-sitter puts the config in
~/.tree-sitter/config.json
. Would it be better if fit in better with the XDG conventions?The text was updated successfully, but these errors were encountered: