Skip to content

Commit ecff1be

Browse files
Copilotna-trium-144
andcommitted
Fix unused variable and stack trace processing logic
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
1 parent 4120fae commit ecff1be

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

app/terminal/wandbox/cpp.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export async function cppRunFiles(
9090
// Track state for processing stack traces
9191
let inStackTrace = false;
9292
let foundSignal = false;
93-
const bufferedStderrForTrace: ReplOutput[] = [];
9493

9594
const result = await compileAndRun({
9695
...options,

app/terminal/wandbox/rust.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,21 @@ export async function rustRunFiles(
8181
// Look for pattern: " N: ..." followed by " at ./file.rs:line"
8282
if (/^\s*\d+:/.test(output.message)) {
8383
traceLines.push(output.message);
84-
} else if (/^\s*at .\//.test(output.message) && traceLines.length > 0) {
85-
// Check if this is user code (not prog.rs)
86-
if (!/^\s*at .\/prog.rs/.test(output.message)) {
87-
onOutput({
88-
type: "trace",
89-
message: traceLines[traceLines.length - 1].replace("prog::", ""),
90-
});
91-
onOutput({
92-
type: "trace",
93-
message: output.message,
94-
});
84+
} else if (/^\s*at .\//.test(output.message)) {
85+
if (traceLines.length > 0) {
86+
// Check if this is user code (not prog.rs)
87+
if (!/^\s*at .\/prog.rs/.test(output.message)) {
88+
onOutput({
89+
type: "trace",
90+
message: traceLines[traceLines.length - 1].replace("prog::", ""),
91+
});
92+
onOutput({
93+
type: "trace",
94+
message: output.message,
95+
});
96+
}
97+
traceLines.pop(); // Remove the processed line whether matched or not
9598
}
96-
traceLines.pop(); // Remove the processed line
9799
}
98100
return;
99101
}

0 commit comments

Comments
 (0)