-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "run test", "debug test" and support a hotkey for re-running the last test #57
Conversation
…ts for that file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some kind of a README on how to get the debug button to work? I wasn't able to figure it out.
@@ -1,4 +1,7 @@ | |||
out | |||
node_modules | |||
.vscode-test/ | |||
zig-cache | |||
.DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.DS_Store
belongs in your global .gitignore
.
@@ -25,7 +25,7 @@ export function zigBuild(): void { | |||
let extraArgs = config.get<string[]>("buildArgs");; | |||
extraArgs.forEach(element => { | |||
processArg.push(element); | |||
}); | |||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental whitespace removal?
if (token && token.isCancellationRequested) break; | ||
|
||
const previousWord = | ||
possibleTestKeyword > -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always true.
continue; | ||
} | ||
|
||
switch (text[possibleTestKeyword + 5].trimLeft()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index out of bounds on "test<EOF>".
|
||
// test "foo" | ||
// ^ | ||
if (text.length > possibleTestKeyword + 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better than last time but it still only matches exactly test "
.
It seems this would be really easy to correctly implement using Regex, just get the subslice between test
and the next {
and see if it matches /test\s*"(.+)"\s*{/
.
Hello. Any updates? Would be this merged by any chance? Oh. I see it uses old VSCode API Codelenses i think. I have implemented it another way with vscode.TestController. |
@Jarred-Sumner I'd been happily using a version of this you built for me but with the merge of the vscode zls/zig extensions things understandably stopped working. Any chance you've got a version of this that you can share? (it made a big deal productively wise!) 😀 |
Closing as abandoned. |
This is a continuation of #51
I have been using this locally for months now. Note that the
@link
mention is outdated, it was removed in a subsequent commit.This:
zig.testArgs
,zig.testCmd
,zig.beforeDebugCmd
Debugging depends on the VSCode LLDB extension. Note that clicking the re-run arrow button currently does not recompile the test. This is an unfortunate side-effect of the VSCode LLDB integration. But, re-running it with a hotkey does do it