Commit graph

51 commits

Author SHA1 Message Date
Max Brunsfeld 4d09c81577 highlight: Avoid accidentally treating locals patterns as highlight patterns 2020-07-10 13:33:04 -07:00
Max Brunsfeld e8e80b1cf1 docs: Use new predicate syntax in highlighting query examples 2020-05-19 16:26:04 -07:00
Max Brunsfeld 1d68896900 highlight: 0.2.0 2020-05-12 16:31:02 -07:00
Max Brunsfeld 4dc82d8b8b Remove unused serde dependency from highlight crate 2020-03-25 12:49:11 -07:00
Max Brunsfeld e23f518915 highlight: add built-in support for carriage-return highlight 2020-01-28 14:47:21 -08:00
Max Brunsfeld 3f109a3cb5 highlight: Fix logic for handling empty injections with no highlights 2020-01-27 12:32:37 -08:00
Max Brunsfeld 9f63139a10 Fix error when set_included_ranges is called with an invalid range list 2020-01-17 10:31:28 -08:00
Max Brunsfeld 9dfd03e79a highlight: Sipmlify injection API w/ new injection.combined property 2020-01-16 12:43:31 -08:00
Han BAO 47a926067d Update README.md (#502)
configure the recognized names for highlighting
2019-12-06 14:00:27 -08:00
Han BAO acc5f092c8 FIxing the README in highlight (#501)
* 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>
2019-12-06 13:05:28 -08:00
Max Brunsfeld 6dbfbaed07 Start work on a system for testing syntax highlighting 2019-12-05 09:45:54 -08:00
Max Brunsfeld 1909ae2cee binding_rust: Improve node children APIs
Closes #480
2019-11-08 14:20:10 -08:00
Max Brunsfeld 9e765ceba6 highlight: Skip injection codepath if there are no ranges found 2019-10-29 13:49:07 -07:00
Max Brunsfeld 71d8d79425 Add missing error codes to C highlight API 2019-10-23 10:57:11 -07:00
Max Brunsfeld 1bc6204870 Handle local.definition-value captures in queries
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.
2019-10-18 15:56:47 -07:00
Max Brunsfeld b73b31356d Respect local.scope-inherits property in local variable queries 2019-10-18 14:12:20 -07:00
Max Brunsfeld 084406148b Tweak highlight name matching semantics, add doc comments 2019-10-17 12:03:34 -07:00
Max Brunsfeld 40408fe6bb Update tree-sitter-highlight readme 2019-10-14 21:39:56 -07:00
Max Brunsfeld 060e00463d Implement include-children directive in injection queries 2019-10-14 17:38:42 -07:00
Max Brunsfeld 7c8216c692 highlight: Handle injections correctly, using a separate query cursor 2019-10-14 12:30:22 -07:00
Max Brunsfeld f4903578f8 Start reimplementing highlight crate with tree queries 2019-10-14 12:30:22 -07:00
Max Brunsfeld 62538ed410 highlight iterator: Return byte offset ranges instead of string slices
Refs #443
2019-09-04 17:29:31 -07:00
Max Brunsfeld ec7756faa0 Add repo URL to Cargo.toml files 2019-08-19 17:31:35 -07:00
Max Brunsfeld bd466febb4 highlight: Fix panic when cancelled before parsing a nested document 2019-07-16 14:34:24 -07:00
Max Brunsfeld a1682eb81c Handle injection-includes-children in highlighting property sheets 2019-06-11 16:59:33 -07:00
Max Brunsfeld 31537a68c6 Bump library versions 2019-05-31 10:24:29 -07:00
Max Brunsfeld cc50f4357b Add missing enumerator in C header for highlighting 2019-05-10 14:38:19 -07:00
Max Brunsfeld e648dc8616 Rename TSHighlightScope -> TSHighlightValue 2019-05-10 10:06:05 -07:00
Max Brunsfeld a7d02e7276 Add support for highlight properties that track local variables 2019-05-09 20:34:34 -07:00
Max Brunsfeld d78ac581f3 Rename scope -> highlight in highlighting property sheets
We need to use the word `scope` for a different purpose: tracking local 
scopes.
2019-05-09 09:42:40 -07:00
Max Brunsfeld 5035e194ff Merge branch 'master' into node-fields 2019-03-26 11:58:21 -07:00
Max Brunsfeld 0ccb910922 Use a size_t instead of a uint32_t for cancellation flag 2019-03-21 11:26:05 -07:00
Max Brunsfeld 3340168097 Fix backwards logic for cancellation flag 2019-03-20 17:02:07 -07:00
Max Brunsfeld 8941dc1dda Add cancellation flag parameter to highlight API 2019-03-18 09:52:02 -07:00
Max Brunsfeld e0f0043edd Highlight: 0.1.5 2019-03-13 16:31:08 -07:00
Max Brunsfeld 083e813218 Highlight: fix handling of root node injections like in ERB, EJS 2019-03-13 15:51:50 -07:00
Max Brunsfeld 2a5409feab Indicate in C API that highlight method doesn't mutate Highlighter 2019-03-13 09:22:09 -07:00
Max Brunsfeld eabecafa8d Highlight.highlight does not mutate 2019-03-12 17:24:21 -07:00
Max Brunsfeld 98e4fd22ef Start work on a C API for syntax highlighting 2019-03-08 13:13:02 -08:00
Max Brunsfeld 445dfda53e binding: Restore handling of multiple symbols w/ same name
Even though normal aliases don't cause this, simple (single-use) aliases still do cause it.
2019-03-05 09:44:43 -08:00
Max Brunsfeld ba165c2909 highlight: 0.1.4 2019-02-25 13:02:50 -08:00
Max Brunsfeld 1bad6dc41e Add ~/.tree-sitter/config.json file, init-config command
Right now this is just used for two things:
* Specifying folders for locarting parsers to use with `tree-sitter 
parse` and `tree-sitter highlight`
* Specifying colors to use for `tree-sitter-highlight`
2019-02-25 12:33:24 -08:00
Max Brunsfeld d3628f3c0c highlight: 0.1.3 2019-02-22 11:50:27 -08:00
Max Brunsfeld 14b7af3436 highlight: Fix HTML rendering of empty lines 2019-02-22 11:48:29 -08:00
Max Brunsfeld 27d4f0d69d highlight: 0.1.2 2019-02-20 16:47:27 -08:00
Max Brunsfeld e239aa8229 highlight: don't include scope in ScopeEnd events
When there are embedded documents, multiple scopes can start or
end at the same position. Previously, there was no guarantee that
the ScopeEnd events would always occur in the reverse order of the
ScopeStart events. The easiest way to avoid exposing inconsistency
is to not surface the scopes being ended.
2019-02-20 16:45:51 -08:00
Max Brunsfeld d63368552a highlight: 0.1.1 2019-02-20 10:42:56 -08:00
Max Brunsfeld 2ee5cbbc1d highlight: take callback parameters by value 2019-02-20 10:27:08 -08:00
Max Brunsfeld c20a330fa5 highlight: Add a README 2019-02-19 17:56:46 -08:00
Max Brunsfeld a46515b80f Replace LanguageRegistry trait with a simple callback 2019-02-19 17:07:12 -08:00