Skip to content

Conversation

@Antman261
Copy link

First slice of zig working end to end.

Let me know if there is anything I should change, e.g. should I make the query less specific? I have never used tree-sitter queries before

@Antman261 Antman261 requested a review from a team as a code owner November 27, 2025 08:58
Copy link
Member

@AndreasArvidsson AndreasArvidsson left a comment

Choose a reason for hiding this comment

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

I've gone through all your new tests and left comments. Please use typescript as a reference language to help you figure out the correct ranges. We do have a scope visualizer on the docs page to help you with this:

Per language:
https://www.cursorless.org/docs/user/languages/typescript/

Per scope:
https://www.cursorless.org/docs/contributing/scopes/argumentList/

The tests are also failing which you need have a look at.

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.

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

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

>-----<
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

>-------------<
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 ", "


[#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

@@ -0,0 +1,62 @@
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.

Please remove the arguments for this tests. Now the file is unnecessarily complicated.


[Removal] = 0:11-0:14
>---<
0| const foo: u8 = 0;
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 : u8

@@ -0,0 +1,20 @@
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.

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


[Removal] = 0:11-0:17
>------<
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 = "bar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants