Skip to content

Commit 3b4c0a8

Browse files
committed
include command to reproduce failing JSON
1 parent f40b2f2 commit 3b4c0a8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

client/src/commands/code_analysis.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ export const runCodeAnalysisWithReanalyze = (
170170
return;
171171
}
172172

173-
let p = cp.spawn(binaryPath, ["reanalyze", "-json"], {
173+
let opts = ["reanalyze", "-json"];
174+
let p = cp.spawn(binaryPath, opts, {
174175
cwd,
175176
});
176177

@@ -218,12 +219,16 @@ export const runCodeAnalysisWithReanalyze = (
218219
outputChannel.show();
219220
});
220221

221-
outputChannel.appendLine("--invalid json start--");
222-
outputChannel.append(data);
223-
outputChannel.appendLine("--invalid json end--");
222+
outputChannel.appendLine("\n\n>>>>");
224223
outputChannel.appendLine(
225-
"Parsing JSON from reanalyze failed. The raw, invalid JSON is logged above this message. Please report this on the extension bug tracker: https://github.com/rescript-lang/rescript-vscode/issues"
224+
"Parsing JSON from reanalyze failed. The raw, invalid JSON can be reproduced by following the instructions below. Please run that command and report the issue + failing JSON on the extension bug tracker: https://github.com/rescript-lang/rescript-vscode/issues"
226225
);
226+
outputChannel.appendLine(
227+
`> To reproduce, run "${binaryPath} ${opts.join(
228+
" "
229+
)}" in directory: "${cwd}"`
230+
);
231+
outputChannel.appendLine("\n");
227232
}
228233

229234
if (json == null) {

0 commit comments

Comments
 (0)