Recently I've been pulling a lot of grammars into GitHub's highlighting backend,
replacing legacy language support with tree-sitter highlighting queries.
Our backend systems have a standard set of highlight captures we expect, very
similar to the standard tagging captures we expect. Though end-user applications
are free to choose whatever tagging nomenclature they want, I think it's nice to
include a checking stage that will help us ensure that we know whether a capture
might be recognized or not. It will also help us figure out where we need to
expand our standard set of captures (see #1539).
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.)
We now have an easier way to get at the language-specific configuration
in Rust, since we publish each language grammar as a crate with useful
accessor functions and globals.
* Correct README.md in /highlight
correct the lifetime in highlighter.highlight and correct the cases in match so that the demo in README could work.
* Update README.md
another small fix
* Update highlight/README.md
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@github.com>
This lets you indicate, when matching a variable definition, that
another later syntax node represents the value of the variable definition,
and so any references to the same variable name within that value node
must be referring to some earlier definition.