Skip to content

Conversation

soorya-u
Copy link
Contributor

@soorya-u soorya-u commented Oct 8, 2025

What it does?

  • Code Lens is not not visible on top of main function which is commented out

@Vexu
Copy link
Member

Vexu commented Oct 8, 2025

This causes the code lens to appear after the last comment instead of before the main function:
image

There is also a similar regex in zigTestRunnerProvider.ts with the same problem if you'd like to fix that as well.

@soorya-u
Copy link
Contributor Author

soorya-u commented Oct 9, 2025

I'm new to zig, so does zig support

test foo { }
// or
test @"foo" { }

The Test Explorer regex recognizes this syntax as a valid test, but the ZLS throws an error.

@Vexu
Copy link
Member

Vexu commented Oct 10, 2025

Both are valid syntax though the second will be normalized to the first by zig fmt. What error is ZLS giving you?

@soorya-u
Copy link
Contributor Author

const foo = "";

// valid
test foo { } 

// invalid: use of undeclared identifier 'bar'
test bar { }

I think the variable should be declared for this syntax. Im not sure though.

As for the PR, I think its working as intended now.

@Vexu
Copy link
Member

Vexu commented Oct 12, 2025

I think the variable should be declared for this syntax. Im not sure though.

Yes it has to be declared, it's a Doctest

@Vexu Vexu merged commit ecbd823 into ziglang:master Oct 12, 2025
1 check passed
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