Commit graph

10 commits

Author SHA1 Message Date
Douglas Creager
66c30648c2 rust: Extract runtime language detection into separate crate
This patch adds a new `tree-sitter-loader` crate, which holds the CLI's
logic for finding and building local grammar definitions at runtime.
This allows other command-line tools to use this logic too!
2021-06-09 17:42:30 -04:00
Douglas Creager
d2d01e77e3 cli: Use anyhow and thiserror for errors
This patch updates the CLI to use anyhow and thiserror for error
management.  The main feature that our custom `Error` type was providing
was a _list_ of messages, which would allow us to annotate "lower-level"
errors with more contextual information.  This is exactly what's
provided by anyhow's `Context` trait.

(This is setup work for a future PR that will pull the `config` and
`loader` modules out into separate crates; by using `anyhow` we wouldn't
have to deal with a circular dependency between with the new crates.)
2021-06-09 16:17:23 -04:00
Patrick Thomson
f3d16f4770 Fix tests. 2020-11-23 11:34:56 -05:00
Patrick Thomson
50bccdf5da rename Assertion.expected to expected_capture_name 2020-11-10 16:20:51 -05:00
Patrick Thomson
1aee60a7c0 propitiate the tests 2020-10-26 14:35:18 -04:00
Patrick Thomson
6adeb7b40d move shared code to query_testing 2020-10-26 14:27:33 -04:00
Patrick Thomson
1012bea3f4 let's start sharing this code 2020-10-26 13:35:10 -04:00
Max Brunsfeld
519a1369ce In highlight test, reset included ranges before finding assertions 2020-06-15 10:51:34 -07:00
Max Brunsfeld
4b9feccd13 Run syntax highlighting tests as part of the main test command
Also, allow `corpus` to be in the `test/corpus` directory, and expect 
highlighting tests to be in the `test/highlight` directory.
2019-12-05 15:28:16 -08:00
Max Brunsfeld
6dbfbaed07 Start work on a system for testing syntax highlighting 2019-12-05 09:45:54 -08:00