@@ -73,22 +73,24 @@ Queries try to follow the [conventions established by tree-sitter.](https://tree
7373
7474Most captures also include documentation as ` @doc ` . ` @definition.function ` and ` @definition.method ` also capture ` @codeium.parameters ` .
7575
76- | | Python | TypeScript | JavaScript | Go |
77- | ---------------------- | ------ | ---------- | ---------- | --- |
78- | ` @definition.class ` | ✅ | ✅ | ✅ | ✅ |
79- | ` @definition.function ` | ✅ | ✅[ ^ 3 ] | ✅ | ✅ |
80- | ` @definition.method ` | ✅[ ^ 1 ] | ✅[ ^ 3 ] | ✅ | ✅ |
81- | ` @definition.interface ` | N/A | ✅ | N/A | ✅ |
82- | ` @definition.namespace ` | N/A | ✅ | N/A | N/A |
83- | ` @definition.module ` | N/A | ✅ | N/A | N/A |
84- | ` @definition.type ` | N/A | ✅ | N/A | ✅ |
85- | ` @definition.constant ` | ❌ | ❌ | ❌ | ❌ |
86- | ` @definition.enum ` | ❌ | ❌ | ❌ | ❌ |
87- | ` @definition.import ` | ❌ | ✅ | ✅ | ❌ |
88- | ` @reference.call ` | ✅ | ✅ | ✅ | ✅ |
89- | ` @reference.class ` | ✅[ ^ 2 ] | ✅ | ✅ | ✅ |
90-
91- [ ^ 1 ] : Currently functions and methods are not distinguished in Python.
76+ | | Python | TypeScript | JavaScript | Go | Java | C++ | PHP |
77+ | ---------------------- | ------ | ---------- | ---------- | --- | ---- | ------ | --- |
78+ | ` @definition.class ` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
79+ | ` @definition.function ` | ✅ | ✅[ ^ 3 ] | ✅ | ✅ | N/A | ✅ | ✅ |
80+ | ` @definition.method ` | ✅[ ^ 1 ] | ✅[ ^ 3 ] | ✅ | ✅ | ✅ | ✅[ ^ 1 ] | ✅ |
81+ | ` @definition.interface ` | N/A | ✅ | N/A | ✅ | ✅ | N/A | ✅ |
82+ | ` @definition.namespace ` | N/A | ✅ | N/A | N/A | N/A | ✅ | ❌ |
83+ | ` @definition.module ` | N/A | ✅ | N/A | N/A | N/A | ❌ | N/A |
84+ | ` @definition.type ` | N/A | ✅ | N/A | ✅ | N/A | ❌ | ❌ |
85+ | ` @definition.constant ` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
86+ | ` @definition.enum ` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
87+ | ` @definition.import ` | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | N/A |
88+ | ` @definition.include ` | N/A | N/A | N/A | N/A | N/A | ❌ | ❌ |
89+ | ` @definition.package ` | N/A | N/A | N/A | ❌ | ✅ | N/A | N/A |
90+ | ` @reference.call ` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
91+ | ` @reference.class ` | ✅[ ^ 2 ] | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
92+
93+ [ ^ 1 ] : Currently functions and methods are not distinguished.
9294[ ^ 2 ] : Function calls and class instantiation are indistinguishable in Python.
9395[ ^ 3 ] : Function and method signatures are captured individually in TypeScript. Therefore, the ` @doc ` capture may not exist on all nodes.
9496
@@ -110,6 +112,11 @@ $ ./parse -supported_predicates
110112 (#has-type? @capture node_type...)
111113 Checks if @capture has a node of any of the given types.
112114
115+ #lineage-from-name!
116+ (#lineage-from-name! "literal")
117+ If the name captures scopes, split by "literal" and retain the last element
118+ as the name. The other elements are appended to the lineage.
119+
113120#match?/#not-match?
114121 (#match? @capture "regex")
115122 Checks if the text for @capture matches the given regular expression.
@@ -120,7 +127,7 @@ $ ./parse -supported_predicates
120127 adjacent lines).
121128
122129#set!
123- (#set! key value )
130+ (#set! key <@capture|"literal"> )
124131 Store metadata as a side effect of a match.
125132
126133#strip!
@@ -161,6 +168,7 @@ shell
161168svelte
162169swift
163170toml
171+ tree_sitter_query
164172tsx
165173typescript
166174vue
0 commit comments