Rename parse_and_diff -> parse_and_get_changed_ranges
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
parent
fce8d57152
commit
131bbee160
3 changed files with 8 additions and 5 deletions
|
|
@ -103,7 +103,7 @@ void ts_document_set_logger(TSDocument *, TSLogger);
|
|||
void ts_document_print_debugging_graphs(TSDocument *, bool);
|
||||
void ts_document_edit(TSDocument *, TSInputEdit);
|
||||
int ts_document_parse(TSDocument *);
|
||||
int ts_document_parse_and_diff(TSDocument *, TSRange **, size_t *);
|
||||
int ts_document_parse_and_get_changed_ranges(TSDocument *, TSRange **, size_t *);
|
||||
void ts_document_invalidate(TSDocument *);
|
||||
TSNode ts_document_root_node(const TSDocument *);
|
||||
size_t ts_document_parse_count(const TSDocument *);
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ describe("Document", [&]() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("parse_and_diff()", [&]() {
|
||||
describe("parse_and_get_changed_ranges()", [&]() {
|
||||
SpyInput *input;
|
||||
|
||||
before_each([&]() {
|
||||
|
|
@ -217,7 +217,7 @@ describe("Document", [&]() {
|
|||
|
||||
TSRange *ranges;
|
||||
size_t range_count = 0;
|
||||
ts_document_parse_and_diff(doc, &ranges, &range_count);
|
||||
ts_document_parse_and_get_changed_ranges(doc, &ranges, &range_count);
|
||||
|
||||
vector<TSRange> result;
|
||||
for (size_t i = 0; i < range_count; i++)
|
||||
|
|
|
|||
|
|
@ -165,7 +165,10 @@ static bool ts_tree_diff(TSDocument *doc, TSTree *old, TSNode *new_node,
|
|||
PRINT("advance before diff ('%s', %lu) -> ('%s', %lu)",
|
||||
NAME(new_node->data), ts_node_start_char(*new_node), NAME(next.data),
|
||||
ts_node_start_char(next));
|
||||
|
||||
*new_node = next;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (new_child_start == old_child_start) {
|
||||
if (!ts_tree_diff(doc, old_child, new_node, depth, results, extend_last_change))
|
||||
|
|
@ -196,7 +199,7 @@ static bool ts_tree_diff(TSDocument *doc, TSTree *old, TSNode *new_node,
|
|||
return true;
|
||||
}
|
||||
|
||||
int ts_document_parse_and_diff(TSDocument *self, TSRange **ranges, size_t *range_count) {
|
||||
int ts_document_parse_and_get_changed_ranges(TSDocument *self, TSRange **ranges, size_t *range_count) {
|
||||
if (ranges) *ranges = NULL;
|
||||
if (range_count) *range_count = 0;
|
||||
|
||||
|
|
@ -238,7 +241,7 @@ int ts_document_parse_and_diff(TSDocument *self, TSRange **ranges, size_t *range
|
|||
}
|
||||
|
||||
int ts_document_parse(TSDocument *self) {
|
||||
return ts_document_parse_and_diff(self, NULL, NULL);
|
||||
return ts_document_parse_and_get_changed_ranges(self, NULL, NULL);
|
||||
}
|
||||
|
||||
void ts_document_invalidate(TSDocument *self) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue