Skip to content
This repository was archived by the owner on Nov 2, 2025. It is now read-only.

Commit 01ce002

Browse files
pqnCopybara Bot
andauthored
Project import generated by Copybara. (#23)
GitOrigin-RevId: 6cffcb49ccb7a4b1f8c40f7c8c84a34c79520971 Co-authored-by: Copybara Bot <[email protected]>
1 parent ba6d65b commit 01ce002

27 files changed

+140
-60
lines changed

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,23 @@ Queries try to follow the [conventions established by tree-sitter.](https://tree
7373

7474
Most captures also include documentation as `@doc`. `@definition.function` and `@definition.method` also capture `@codeium.parameters`.
7575

76-
| Top-level capture | 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] |||||||
76+
| Top-level capture | Python | TypeScript | JavaScript | Go | Java | C++ | PHP | Ruby |
77+
| ------------------------- | ------ | ---------- | ---------- | --- | ---- | ------ | --- | ---- |
78+
| `@definition.class` |||||||||
79+
| `@definition.function` ||[^3] ||| N/A ||| N/A |
80+
| `@definition.method` |[^1] |[^3] ||||[^1] |||
81+
| `@definition.constructor` |||| N/A |||||
82+
| `@definition.interface` | N/A || N/A ||| N/A |||
83+
| `@definition.namespace` | N/A || N/A | N/A | N/A ||| N/A |
84+
| `@definition.module` | N/A || N/A | N/A | N/A || N/A ||
85+
| `@definition.type` | N/A || N/A || N/A ||| N/A |
86+
| `@definition.constant` |||||||||
87+
| `@definition.enum` |||||||| N/A |
88+
| `@definition.import` ||||||| N/A ||
89+
| `@definition.include` | N/A | N/A | N/A | N/A | N/A ||| N/A |
90+
| `@definition.package` | N/A | N/A | N/A ||| N/A | N/A | N/A |
91+
| `@reference.call` |||||||||
92+
| `@reference.class` |[^2] ||||||||
9293

9394
| Language | Supported injections |
9495
| -------- | ---------------------- |

download_parse.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
cd "$(dirname "${BASH_SOURCE[0]}")"
5-
VERSION="v0.0.12"
5+
VERSION="v0.0.13"
66
rm -f parse.gz parse
77
curl -Lo parse.gz "https://github.com/Exafunction/codeium-parse/releases/download/$VERSION/parse.gz"
88
gzip -d parse.gz

goldens/test.cpp.golden

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Name: Foo
3030
Definition (definition.class):
3131
class Foo {
3232
public:
33+
// Constructor comment.
34+
Foo() = default;
35+
// Constructor comment.
36+
explicit Foo(int /*unused*/) {}
3337
// foo
3438
// foo2
3539
void foo() {

goldens/test.go.golden

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Return type: string
5656
Definition (definition.method):
5757
func (p Pattern0) Method2(a string) string {
5858
Pattern2()
59-
s := &Pattern0{}
59+
s := &Pattern0{a: "foo"}
6060
s.Method("")
6161
((*Pattern0)(s)).Method("")
6262
var s2 any
@@ -72,8 +72,9 @@ Reference (reference.call):
7272
Pattern2()
7373

7474
Name: Pattern0
75+
Parameters: {a: "foo"}
7576
Reference (reference.class):
76-
Pattern0{}
77+
Pattern0{a: "foo"}
7778

7879
Name: Method
7980
Parent: s

goldens/test.java.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Doc:
99
// Class Foo.
1010
Definition (definition.class):
1111
public class Foo {
12+
// Constructor comment.
13+
public Foo() {}
1214
/** Foo1. */
1315
static public void foo1(int x) {}
1416
}

goldens/test.js.golden

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class Pattern1a {
4444
}
4545
}
4646

47+
Name: constructor
48+
Parameters: ()
49+
Definition (definition.constructor):
50+
constructor() {}
51+
Lineage: [Pattern1a]
52+
Lineage types: [class]
53+
4754
Name: pattern0
4855
Parameters: (param1)
4956
Doc:

goldens/test.php.golden

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Doc:
3535
Definition (definition.class):
3636
class FooClass implements FooInterface
3737
{
38+
// Constructor comment.
39+
function __construct() {}
3840
/**
3941
* @param mixed $numbers
4042
* @return string
@@ -46,6 +48,15 @@ class FooClass implements FooInterface
4648
Lineage: [test]
4749
Lineage types: [namespace]
4850

51+
Name: __construct
52+
Parameters: ()
53+
Doc:
54+
// Constructor comment.
55+
Definition (definition.method):
56+
function __construct() {}
57+
Lineage: [test FooClass]
58+
Lineage types: [namespace class]
59+
4960
Name: encode
5061
Parameters: (...$numbers)
5162
Doc:

goldens/test.py.golden

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ Doc:
3232
Definition (definition.class):
3333
class Pattern0:
3434
"""Pattern 0 docstring."""
35+
def __init__(self):
36+
pass
37+
38+
Name: __init__
39+
Parameters: (self)
40+
Definition (definition.constructor):
41+
def __init__(self):
42+
pass
43+
Lineage: [Pattern0]
44+
Lineage types: [class]
3545

3646
Name: Pattern0NoDoc
3747
Definition (definition.class):

goldens/test.rb.golden

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Doc:
88
# nothing strange here
99
Declaration (definition.class):
1010
class SomeClass
11+
def initialize
12+
end
1113
# In ruby, the parentheses can be omitted in many circumstances
1214
# This is probably a job for the AST, but we'll add a test here anyway
1315
def empty_parens()
@@ -17,6 +19,9 @@ end
1719

1820
Name: empty_parens
1921
Parameters: ()
22+
Doc:
23+
# In ruby, the parentheses can be omitted in many circumstances
24+
# This is probably a job for the AST, but we'll add a test here anyway
2025
Definition (definition.method):
2126
def empty_parens()
2227
"Nice"

goldens/test.tsx.golden

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,23 @@ Doc:
111111
/** Foo comment. */
112112
Definition (definition.class):
113113
class Foo {
114+
// Constructor comment.
115+
constructor() {}
114116
/** methodSignature comment. */
115117
methodSignature(): void;
116118
/** methodSignature comment. */
117119
methodSignature(): void {}
118120
}
119121

122+
Name: constructor
123+
Parameters: ()
124+
Doc:
125+
// Constructor comment.
126+
Definition (definition.constructor):
127+
constructor() {}
128+
Lineage: [Foo]
129+
Lineage types: [class]
130+
120131
Name: methodSignature
121132
Parameters: ()
122133
Return type: void

0 commit comments

Comments
 (0)