Skip to content

Commit cd61c3e

Browse files
authored
feat: vscode extension, more intutive compile errors (#1775)
* feat: more intutive compile errors * chore: rename variable to be more intuitive
1 parent d3d0194 commit cd61c3e

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

vscode/server.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ async function applySettings() {
6060
}
6161

6262
async function compileAndValidate() {
63+
let compilationFailed = false;
6364
const spawnedProcess = spawn(
6465
(process.platform !== "win32") ? "dataform" : "dataform.cmd",
6566
["compile", "--json", ...settings.compilerOptions]
@@ -76,11 +77,7 @@ async function compileAndValidate() {
7677
);
7778
return;
7879
} else {
79-
connection.sendNotification(
80-
"error",
81-
"Errors encountered when running 'dataform' CLI. Please check the output for more information."
82-
);
83-
return;
80+
compilationFailed = true;
8481
}
8582
}
8683

@@ -99,8 +96,15 @@ async function compileAndValidate() {
9996

10097
if (parsedResult?.graphErrors?.compilationErrors) {
10198
parsedResult.graphErrors.compilationErrors.forEach(compilationError => {
102-
connection.sendNotification("error", compilationError.message);
99+
connection.sendNotification("error", compilationError.fileName + ": " + compilationError.message);
103100
});
101+
if (compilationFailed) {
102+
connection.sendNotification(
103+
"error",
104+
"Errors encountered when running 'dataform' CLI. Please check the output for more information."
105+
);
106+
return;
107+
}
104108
} else {
105109
connection.sendNotification("success", "Project compiled successfully");
106110
}

0 commit comments

Comments
 (0)