Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3cb55ab
Add first zig scope facet
Antman261 Nov 27, 2025
0abea27
Update queries/zig.scm
Antman261 Nov 27, 2025
c2fe2de
Update packages/common/src/scopeSupportFacets/zig.ts
Antman261 Nov 27, 2025
d56874b
Update packages/common/src/scopeSupportFacets/zig.ts
Antman261 Nov 27, 2025
bef3efe
Merge branch 'main' into main
Antman261 Nov 27, 2025
1f32c82
Apply suggestion from @AndreasArvidsson
Antman261 Nov 27, 2025
94a9433
add more scopes and scope tests
Antman261 Nov 27, 2025
8eb1fe7
Merge branch 'main' into main
Antman261 Nov 28, 2025
957ca92
wip: improving zig scm
Antman261 Nov 28, 2025
05929f9
Merge branch 'main' of https://github.com/Antman261/cursorless
Antman261 Nov 28, 2025
15b273c
wip: improve Zig scm
Antman261 Nov 28, 2025
1c060d3
Improve scm examples
Antman261 Dec 1, 2025
69cd67b
Update arg list test
Antman261 Dec 1, 2025
e03a4f6
wip: add more scope tests
Antman261 Dec 1, 2025
f35dd75
wip: improving argument iteration and domain
Antman261 Dec 22, 2025
35d1442
wip: function declaration argument iteration working
Antman261 Dec 22, 2025
07aed70
wip: fix variable declaration type removal of leading ":"
Antman261 Dec 22, 2025
f7dfc6f
Merge branch 'main' into main
Antman261 Dec 22, 2025
3137256
Remove unsupported arg iteration scopes
Antman261 Dec 22, 2025
55e6843
Merge branch 'main' of https://github.com/Antman261/cursorless
Antman261 Dec 22, 2025
fa4bbcd
Remove unsupported scope files
Antman261 Dec 22, 2025
86f322e
Add zig language page to docs
Antman261 Dec 22, 2025
4d093f3
Fix bug with argument actual
Antman261 Dec 22, 2025
80b9512
Merge branch 'main' into main
AndreasArvidsson Dec 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions data/fixtures/scopes/zig/argument.actual.multiLine.scope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. bbb is missing as a scope
  2. The removal range of aaa is incorrect
  3. The insertion delimiter is incorrect for a multiline argument

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
foo(
aaa,
bbb
);
---

[Content] =
[Domain] = 1:4-1:7
>---<
1| aaa,

[Removal] = 1:0-1:7
>-------<
1| aaa,

[Leading delimiter] = 1:0-1:4
>----<
1| aaa,

[Insertion delimiter] = " "
10 changes: 10 additions & 0 deletions data/fixtures/scopes/zig/argument.actual.singleLine.scope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. bbb is missing as a scope
  2. The removal range of aaa is incorrect
  3. The insertion delimiter is incorrect

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
foo(aaa, bbb);
---

[Content] =
[Removal] =
[Domain] = 0:4-0:7
>---<
0| foo(aaa, bbb);

[Insertion delimiter] = " "
10 changes: 10 additions & 0 deletions data/fixtures/scopes/zig/argument.formal.iteration.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn foo(aaa: u8, bbb: u8) void {}
---

[Content] = 0:7-0:23
>----------------<
0| fn foo(aaa: u8, bbb: u8) void {}

[Domain] = 0:0-0:32
>--------------------------------<
0| fn foo(aaa: u8, bbb: u8) void {}
44 changes: 44 additions & 0 deletions data/fixtures/scopes/zig/argument.formal.multiLine.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
fn foo(
aa: u8,
bb: u8,
) void {}
---

[#1 Content] =
[#1 Domain] = 1:4-1:10
>------<
1| aa: u8,

[#1 Removal] = 1:4-2:4
>-------
1| aa: u8,
2| bb: u8,
----<

[#1 Trailing delimiter] = 1:10-2:4
>-
1| aa: u8,
2| bb: u8,
----<

[#1 Insertion delimiter] = ",\n"


[#2 Content] =
[#2 Domain] = 2:4-2:10
>------<
2| bb: u8,

[#2 Removal] = 1:10-2:10
>-
1| aa: u8,
2| bb: u8,
----------<

[#2 Leading delimiter] = 1:10-2:4
>-
1| aa: u8,
2| bb: u8,
----<

[#2 Insertion delimiter] = ",\n"
10 changes: 10 additions & 0 deletions data/fixtures/scopes/zig/argument.formal.singleLine.scope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include a second argument so we get a separate removal range in this scope test

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn foo(arg: u8) void {}
---

[Content] =
[Removal] =
[Domain] = 0:7-0:14
>-------<
0| fn foo(arg: u8) void {}

[Insertion delimiter] = ", "
13 changes: 13 additions & 0 deletions data/fixtures/scopes/zig/argumentList.actual.empty.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
foo();
---

[Content] =
[Removal] = 0:4-0:4
><
0| foo();

[Domain] = 0:0-0:5
>-----<
0| foo();

[Insertion delimiter] = " "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insertion delimiter should be an empty string

13 changes: 13 additions & 0 deletions data/fixtures/scopes/zig/argumentList.actual.singleLine.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
foo(aaa, bbb);
---

[Content] =
[Removal] = 0:4-0:12
>--------<
0| foo(aaa, bbb);

[Domain] = 0:0-0:13
>-------------<
0| foo(aaa, bbb);

[Insertion delimiter] = " "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insertion delimiter should be ", "

13 changes: 13 additions & 0 deletions data/fixtures/scopes/zig/argumentList.formal.empty.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn foo() void {}
---

[Content] =
[Removal] = 0:7-0:7
><
0| fn foo() void {}

[Domain] = 0:0-0:16
>----------------<
0| fn foo() void {}

[Insertion delimiter] = " "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insertion limiter should be ""

32 changes: 32 additions & 0 deletions data/fixtures/scopes/zig/argumentList.formal.multiLine.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
foo(
aaa,
bbb
);
---

[Content] = 1:4-2:7
>-----
1| aaa,
2| bbb
-------<

[Removal] = 1:0-3:0
>---------
1| aaa,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal range should start directly after the opening parentheses

2| bbb
3| );
<

[Leading delimiter] = 1:0-1:4
>----<
1| aaa,

[Domain] = 0:0-3:1
>----
0| foo(
1| aaa,
2| bbb
3| );
-<

[Insertion delimiter] = " "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insertion delimiter should be ",\n"

13 changes: 13 additions & 0 deletions data/fixtures/scopes/zig/argumentList.formal.singleLine.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn foo(aaa: u8, bbb: u8) void {}
---

[Content] =
[Removal] = 0:7-0:23
>----------------<
0| fn foo(aaa: u8, bbb: u8) void {}

[Domain] = 0:0-0:32
>--------------------------------<
0| fn foo(aaa: u8, bbb: u8) void {}

[Insertion delimiter] = " "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insertion delimiter should be ", "

10 changes: 10 additions & 0 deletions data/fixtures/scopes/zig/functionCall.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
foo();
---

[Content] =
[Removal] =
[Domain] = 0:0-0:5
>-----<
0| foo();

[Insertion delimiter] = " "
13 changes: 13 additions & 0 deletions data/fixtures/scopes/zig/functionCallee.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
foo(aa, bb);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need any arguments for this particular test

---

[Content] =
[Removal] = 0:0-0:3
>---<
0| foo(aa, bb);

[Domain] = 0:0-0:11
>-----------<
0| foo(aa, bb);

[Insertion delimiter] = " "
55 changes: 55 additions & 0 deletions data/fixtures/scopes/zig/name.argument.formal.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
fn foo(aaa: u8, bbb: u8) void {}
---

[#1 Content] =
[#1 Removal] = 0:3-0:6
>---<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Leading delimiter] = 0:2-0:3
>-<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Domain] = 0:0-0:32
>--------------------------------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Insertion delimiter] = " "


[#2 Content] = 0:7-0:10
>---<
0| fn foo(aaa: u8, bbb: u8) void {}

[#2 Removal] = 0:7-0:16
>---------<
0| fn foo(aaa: u8, bbb: u8) void {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other languages we don't include the type in the rim wall range. Please just make the removable range the same as the content range.


[#2 Trailing delimiter] = 0:10-0:16
>------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#2 Domain] = 0:7-0:14
>-------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#2 Insertion delimiter] = " "


[#3 Content] = 0:16-0:19
>---<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Removal] = 0:14-0:19
>-----<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Leading delimiter] = 0:14-0:16
>--<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Domain] = 0:16-0:23
>-------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Insertion delimiter] = " "
24 changes: 24 additions & 0 deletions data/fixtures/scopes/zig/name.assignment.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const foo = "bar";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assignment scope should be assigning to an already existing variable. Please rename this file to name.variable.

---

[Content] = 0:6-0:9
>---<
0| const foo = "bar";

[Removal] = 0:6-0:10
>----<
0| const foo = "bar";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal range should be const foo =


[Leading delimiter] = 0:5-0:6
>-<
0| const foo = "bar";

[Trailing delimiter] = 0:9-0:10
>-<
0| const foo = "bar";

[Domain] = 0:0-0:18
>------------------<
0| const foo = "bar";

[Insertion delimiter] = " "
17 changes: 17 additions & 0 deletions data/fixtures/scopes/zig/name.function.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
fn foo() void {}
---

[Content] =
[Removal] = 0:3-0:6
>---<
0| fn foo() void {}

[Leading delimiter] = 0:2-0:3
>-<
0| fn foo() void {}

[Domain] = 0:0-0:16
>----------------<
0| fn foo() void {}

[Insertion delimiter] = " "
10 changes: 10 additions & 0 deletions data/fixtures/scopes/zig/namedFunction.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn someFunk() void {}
---

[Content] =
[Removal] =
[Domain] = 0:0-0:21
>---------------------<
0| fn someFunk() void {}

[Insertion delimiter] = "\n\n"
10 changes: 10 additions & 0 deletions data/fixtures/scopes/zig/statement.assignment.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const foo = "hello";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assignment should be assigning a value to an already existing variable. Please rename this file to statement.variable

---

[Content] =
[Removal] =
[Domain] = 0:0-0:20
>--------------------<
0| const foo = "hello";

[Insertion delimiter] = "\n"
62 changes: 62 additions & 0 deletions data/fixtures/scopes/zig/type.argument.formal.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
fn foo(aaa: u8, bbb: u8) void {}
---

[#1 Content] = 0:25-0:29
>----<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Removal] = 0:25-0:30
>-----<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Leading delimiter] = 0:24-0:25
>-<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Trailing delimiter] = 0:29-0:30
>-<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Domain] = 0:0-0:32
>--------------------------------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#1 Insertion delimiter] = " "


[#2 Content] = 0:12-0:14
>--<
0| fn foo(aaa: u8, bbb: u8) void {}

[#2 Removal] = 0:12-0:16
>----<
0| fn foo(aaa: u8, bbb: u8) void {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal range should be : u8

0| function foo(aaa: number, bbb?: number = 0) {}


[#2 Trailing delimiter] = 0:14-0:16
>--<
0| fn foo(aaa: u8, bbb: u8) void {}

[#2 Domain] = 0:7-0:14
>-------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#2 Insertion delimiter] = " "


[#3 Content] = 0:21-0:23
>--<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Removal] = 0:14-0:23
>---------<
0| fn foo(aaa: u8, bbb: u8) void {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem here


[#3 Leading delimiter] = 0:14-0:21
>-------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Domain] = 0:16-0:23
>-------<
0| fn foo(aaa: u8, bbb: u8) void {}

[#3 Insertion delimiter] = " "
Loading
Loading