Skip to content

Commit fde3e63

Browse files
feat(node)!: remove getChildContainingDescendant
1 parent 59a90cd commit fde3e63

File tree

4 files changed

+0
-23
lines changed

4 files changed

+0
-23
lines changed

scripts/jextract.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ $lib = "$($args[0])/core/lib"
3838
--include-function ts_node_child `
3939
--include-function ts_node_child_by_field_id `
4040
--include-function ts_node_child_by_field_name `
41-
--include-function ts_node_child_containing_descendant `
4241
--include-function ts_node_child_with_descendant `
4342
--include-function ts_node_child_count `
4443
--include-function ts_node_descendant_count `

scripts/jextract.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ exec jextract \
4040
--include-function ts_node_child \
4141
--include-function ts_node_child_by_field_id \
4242
--include-function ts_node_child_by_field_name \
43-
--include-function ts_node_child_containing_descendant \
4443
--include-function ts_node_child_with_descendant \
4544
--include-function ts_node_child_count \
4645
--include-function ts_node_descendant_count \

src/main/java/io/github/treesitter/jtreesitter/Node.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,6 @@ public Optional<Node> getNamedDescendant(Point start, Point end) {
408408
return optional(ts_node_named_descendant_for_point_range(arena, self, startPoint, endPoint));
409409
}
410410

411-
/**
412-
* Get the child of the node that contains the given descendant, if any.
413-
*
414-
* @apiNote This method will not return the descendant if it is a direct child of this node.
415-
* @deprecated Use {@link #getChildWithDescendant} instead.
416-
*/
417-
@Deprecated(forRemoval = true)
418-
@SuppressWarnings("DeprecatedIsStillUsed")
419-
public Optional<Node> getChildContainingDescendant(Node descendant) {
420-
return optional(ts_node_child_containing_descendant(arena, self, descendant.self));
421-
}
422-
423411
/**
424412
* Get the node that contains the given descendant, if any.
425413
*

src/test/java/io/github/treesitter/jtreesitter/NodeTest.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,6 @@ void getNamedDescendantPoints() {
267267
assertEquals("identifier", descendant.getGrammarType());
268268
}
269269

270-
@Test
271-
@SuppressWarnings("removal")
272-
void getChildContainingDescendant() {
273-
var descendant = node.getChild(0).orElseThrow();
274-
descendant = descendant.getChild(0).orElseThrow();
275-
var child = node.getChildContainingDescendant(descendant);
276-
assertEquals("class_declaration", child.orElseThrow().getType());
277-
}
278-
279270
@Test
280271
void getChildWithDescendant() {
281272
var descendant = node.getChild(0).orElseThrow();

0 commit comments

Comments
 (0)