Max Brunsfeld
28011b1e60
Add ts_node_is_extra API
2019-06-19 15:58:29 -07:00
Max Brunsfeld
80b785daee
Improve behavior of node descendant queries with single positions
2019-06-13 10:53:59 -07:00
Max Brunsfeld
a1682eb81c
Handle injection-includes-children in highlighting property sheets
2019-06-11 16:59:33 -07:00
Max Brunsfeld
d274e81d0d
Overhaul CLI error handling to allow multiple levels of context
2019-05-30 16:52:55 -07:00
Max Brunsfeld
7bc7306afb
Add a unit test for local variable tracking in syntax highlighting
2019-05-10 14:38:43 -07:00
Max Brunsfeld
958ab27efb
Update JS highlighting unit test
2019-05-10 10:32:31 -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
572f290ec0
Fix highlighting in the presence of node fields
2019-05-07 11:17:34 -07:00
Max Brunsfeld
58e1a0fee7
In node range queries, treat the end coordinate as exclusive
2019-04-26 13:36:28 -07:00
Max Brunsfeld
701d63dab7
Add --edit flag to parse command
2019-04-08 09:21:03 -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
0ae304f582
Lib: Rework the API for cancelling a parse
...
Also, use beta on CI until atomic::AtomicU32 lands in stable.
2019-03-18 09:51:21 -07:00
Jacob Mitchell
15b096d695
Extract graph log validation into a specialized test
2019-03-14 22:21:19 -07:00
Jacob Mitchell
c8d040ca26
Use 1-indexed rows in CLI and log output ( resolves #287 )
2019-03-14 22:21:19 -07:00
Max Brunsfeld
1aaad66a03
Merge pull request #301 from tree-sitter/clock-based-timeouts
...
Replace operation limit API with a clock-based timeout API
2019-03-14 16:50:44 -07:00
Max Brunsfeld
9ae594a507
Be more loose with timeout unit test assertions
2019-03-14 15:53:45 -07:00
Max Brunsfeld
006a931ab8
Tests: Prevent array reallocations during ts_stack_print_dot_graph
...
When debugging a test with 'script/test -D', the DOT-graph generation
code was sometimes causing reallocations that were not captured by the
allocation tracker, because we explicitly disable allocation-tracking
for that method in order to reduce noise when debugging memory leaks.
By growing the relevant array *prior* to turning off allocation
tracking, we can ensure that it is not reallocated within that function,
avoiding false positive memory leak errors.
Fixes #302
2019-03-14 13:59:12 -07:00
Max Brunsfeld
cddb3e416d
Replace operation limit API with a clock-based timeout API
2019-03-14 11:13:38 -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
98e4fd22ef
Start work on a C API for syntax highlighting
2019-03-08 13:13:02 -08:00
Max Brunsfeld
f52271352b
Merge branch 'master' into node-fields
2019-03-05 08:08:05 -08:00
Max Brunsfeld
14b7af3436
highlight: Fix HTML rendering of empty lines
2019-02-22 11:48:29 -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
a46515b80f
Replace LanguageRegistry trait with a simple callback
2019-02-19 17:07:12 -08:00
Max Brunsfeld
e89b6b2402
Add a highlight subcommand
2019-02-19 12:32:03 -08:00
Max Brunsfeld
4f069fbe3b
Merge branch 'master' into node-fields
2019-02-14 09:35:47 -08:00
Max Brunsfeld
57c528b6c5
CLI: Determine language symbol from grammar, not package.json
...
Fixes #272
Fixes #277
2019-02-13 19:31:26 -08:00
Max Brunsfeld
65d1ce8593
lib: Include fields in ts_node_string output
...
This allows you to assert about fields in tests. But if your test
s-expression does *not* include fields, the fields will be stripped from
the regexp before comparison.
2019-02-13 09:47:21 -08:00
Max Brunsfeld
9f608435ee
Fix errors in when languages have no fields
2019-02-12 17:20:12 -08:00
Max Brunsfeld
a7206b1b8b
Add some assertions to node field test
2019-02-08 16:25:27 -08:00
Max Brunsfeld
1d1674811c
Fully implement ts_node_child_by_field_id
2019-02-08 15:16:56 -08:00
Max Brunsfeld
18a13b457d
Get basic field API working
2019-02-08 15:16:56 -08:00
Max Brunsfeld
bf4e1304f8
Start work on new ref API, for giving names to nodes' children
...
Co-Authored-By: Ayman Nadeem <aymannadeem@gmail.com>
2019-02-08 15:16:56 -08:00
Vicent Marti
a8cc082ce2
binding: Make walk_with_properties take an &[u8]
2019-02-06 10:10:55 +01:00
Max Brunsfeld
50281637d7
binding: Make parse methods more convenient
...
* Rename parse_str to parse and make it polymorphic.
* Rename parse_utf8 to parse_with, since it is now the callback-based
version of parse
* Add a parse_utf16 method analogous to parse
* Rename existing parse_utf16 method to parse_utf16_with
This brings in the changes from tree-sitter/rust-tree-sitter#5
2019-02-05 10:59:33 -08:00
Max Brunsfeld
efe79889be
Port node tests
2019-02-04 20:42:56 -08:00
Max Brunsfeld
9a8cf39277
Add incremental parsing unit tests
2019-02-04 16:43:21 -08:00
Max Brunsfeld
4a98f0b87e
Port unit test for missing tokens and included ranges
2019-02-04 14:44:06 -08:00
Max Brunsfeld
e62a8a2302
Port more parser unit tests
2019-02-04 10:38:44 -08:00
Max Brunsfeld
6b8483c53c
Start work on porting included range unit tests
2019-02-02 22:57:04 -08:00
Max Brunsfeld
d465850aba
Add unit tests for ts_tree_get_changed_ranges
2019-02-02 14:00:11 -08:00
Max Brunsfeld
f263a4fbe3
Separate walk_with_properties tests from parser tests
2019-02-01 21:20:27 -08:00
Max Brunsfeld
4cac85fec4
Add benchmark script
...
* Structure `cli` crate as both a library and an executable, so that
benchmarks can import code from the crate.
* Import macros in the Rust 2018 style.
2019-02-01 15:17:35 -08:00
Max Brunsfeld
e26cbb62a5
Add Tree::edit unit tests
2019-01-31 08:15:30 -08:00
Max Brunsfeld
5927e104c2
Check tree consistency in randomized tests
2019-01-26 22:22:29 -08:00
Max Brunsfeld
af83e8034e
Move test helpers into their own folder
2019-01-25 16:40:26 -08:00
Max Brunsfeld
5a12fbd927
Verify changed ranges in randomized tests
2019-01-25 15:20:34 -08:00