Commit graph

16 commits

Author SHA1 Message Date
Amaan Qureshi
5825e24d56 style: wrap comments 2024-04-11 22:35:43 -04:00
Amaan Qureshi
b35efa8f33 style: format imports 2024-04-11 22:35:43 -04:00
Will Lillis
f894a5350c
feat(cli): add optional config-path argument 2024-02-21 12:02:12 -05:00
Amaan Qureshi
1b44a6f912
chore(config): apply clippy fixes 2024-02-03 19:38:30 -05:00
Andrew Hlynskyi
0862921537 doc: Include README as top-level module documentation for all crates 2023-08-28 23:09:37 +03:00
sogaiu
23ce370fa3 cli: Stop config.json search sooner if TREE_SITTER_DIR set 2023-01-16 15:30:40 +09:00
sogaiu
adeb8d0aa9 cli: Make init-config respect TREE_SITTER_DIR 2023-01-16 15:30:38 +09:00
Andrew Hlynskyi
f627a97d24 loader: use portable way of path joining 2023-01-11 04:12:13 +02:00
rhysd
21c6cd8c22 cli: fix warnings from cargo doc 2022-05-31 10:59:30 +09:00
Max Brunsfeld
64e6c11566
Merge pull request #1234 from ahlinc/fix/imrove-config-loading-err-msgs
fix(cli): Improve error messages on config.json loading, closes #1227
2021-07-15 20:37:40 -07:00
Andrew Hlynskyi
13108baef7 fix(cli): Improve error messages on config.json loading, closes #1227 2021-07-16 05:43:39 +03:00
Andrew Hlynskyi
bc94c0cc2f fix(cli): fix theme key loading from config.json, closes #1232 2021-07-03 03:38:24 +03:00
Vladimir Panteleev
09e2e9fe87
fix(cli): Avoid ENOENT if config.json is not in TREE_SITTER_DIR
Fixes #1222.
2021-07-01 20:58:23 +00:00
Andrew Hlynskyi
2e2b239c42 fix(cli): Don't silently overwrite existing config file 2021-06-27 03:15:35 +03:00
Douglas Creager
b44270efab cli: Missing config file shouldn't be an error
Just fall back on the default values for each configuration option.
2021-06-10 10:22:20 -04:00
Douglas Creager
e841fcfa1b cli: Extract CLI configuration into separate crate
This patch adds the `tree-sitter-config` crate, which manages
tree-sitter's configuration file.  This new setup allows different
components to define their own serializable configuration types, instead
of having to create a single monolithic configuration type.  But the
configuration itself is still stored in a single JSON file.

Before, the default location for the configuration file was
`~/.tree-sitter/config.json`.  This patch updates the default location
to follow the XDG Base Directory spec (or other relevant platform-
specific spec).  So on Linux, for instance, the new default location is
`~/.config/tree-sitter/config.json`.  We will look in the new location
_first_, and fall back on reading from the legacy location if we can't
find anything.
2021-06-10 10:21:22 -04:00