Skip to content

Commit 104c840

Browse files
fix: vscode extension crash on windows due to *.cmd spawn (#1814)
* fix: vscode extension crash on windows due to *.cmd spawn * fix: vscode extension build
1 parent 1868d37 commit 104c840

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@
7272
"url": "^0.11.0",
7373
"vm2": "3.9.19",
7474
"vsce": "^1.79.5",
75+
"vscode-jsonrpc": "^5.0.1",
7576
"vscode-languageclient": "^6.1.3",
7677
"vscode-languageserver": "^6.1.1",
78+
"vscode-languageserver-protocol": "^3.15.3",
7779
"vscode-languageserver-textdocument": "^1.0.1",
80+
"vscode-languageserver-types": "3.15.1",
7881
"webpack": "^4.20.0",
7982
"webpack-cli": "^3.3.10",
8083
"yargs": "^16.2.0"

vscode/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ export async function activate(context: vscode.ExtensionContext) {
4747

4848
// wait for client to be ready before setting up notification handlers
4949
await client.onReady();
50-
client.onNotification("error", errorMessage => {
50+
client.onNotification("error", (errorMessage: string) => {
5151
vscode.window.showErrorMessage(errorMessage);
5252
});
53-
client.onNotification("info", message => {
53+
client.onNotification("info", (message: string) => {
5454
vscode.window.showInformationMessage(message);
5555
});
56-
client.onNotification("success", message => {
56+
client.onNotification("success", (message: string) => {
5757
vscode.window.showInformationMessage(message);
5858
});
5959

vscode/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ async function applySettings() {
6464

6565
async function compileAndValidate() {
6666
let compilationFailed = false;
67-
const spawnedProcess = spawn(process.platform !== "win32" ? "dataform" : "dataform.cmd", [
67+
const spawnedProcess = spawn("dataform", [
6868
"compile",
6969
"--json",
70-
...settings.compilerOptions
71-
]);
70+
...settings.compilerOptions,
71+
], {shell: true});
7272

7373
const compileResult = await getProcessResult(spawnedProcess);
7474
if (compileResult.exitCode !== 0) {

0 commit comments

Comments
 (0)