Skip to content

Commit b4be3dc

Browse files
rcosta358codex
andcommitted
Keep playground directory in diagnostic locations
Co-authored-by: Codex <codex@openai.com>
1 parent a1d0958 commit b4be3dc

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎scripts/playground/diagnostics.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AnsiUp } from 'ansi_up';
22

33
function shortenLocations(output) {
4-
return output.replace(/^\/files\/playground\/(?=[^/\r\n]+:\d+)/gm, '');
4+
return output.replace(/^\/files\/playground\/(?=[^/\r\n]+:\d+)/gm, '/playground/');
55
}
66

77
export function editorDiagnostic(issue, length) {

‎scripts/playground/diagnostics.test.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ test('omit leading CLI blank lines while preserving diagnostic spacing and color
77
assert.equal(diagnosticHtml('\n\n' + diagnostic), diagnosticHtml(diagnostic));
88
});
99

10-
test('show only the filename and line in diagnostic locations', () => {
10+
test('show the playground path, filename and line in diagnostic locations', () => {
1111
const output = '\u001b[31mError\u001b[0m\n\n/files/playground/Example.java:6\u001b[0m\n\n--> Refinement declared here:\n/files/playground/Example.java:5\u001b[0m\n';
12-
const expected = output.replaceAll('/files/playground/', '');
12+
const expected = output.replaceAll('/files/playground/', '/playground/');
1313
assert.equal(diagnosticHtml(output), diagnosticHtml(expected));
1414
assert.equal(editorDiagnostic({ from: 0, to: 1, output }, 1).message,
1515
expected.replace(/\u001b\[[0-9;]*m/g, ''));

0 commit comments

Comments
 (0)