Skip to content

Commit 786788b

Browse files
committed
IDE: Set working directory when starting sbt
1 parent c1f0e75 commit 786788b

File tree

3 files changed

+21
-66
lines changed

3 files changed

+21
-66
lines changed

vscode-dotty/package-lock.json

Lines changed: 14 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-dotty/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"scala-lang.scala"
7272
],
7373
"dependencies": {
74-
"child-process-promise": "^2.2.1",
74+
"promisify-child-process": "^2.1.2",
7575
"compare-versions": "^3.4.0",
7676
"vscode-languageclient": "^5.1.0",
7777
"vscode-languageserver": "^5.1.0",

vscode-dotty/src/extension.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import * as fs from 'fs';
44
import * as path from 'path';
55

6-
import * as cpp from 'child-process-promise';
6+
import * as cpp from 'promisify-child-process';
77
import * as compareVersions from 'compare-versions';
88

99
import { ChildProcess } from "child_process";
@@ -224,7 +224,9 @@ function startNewSbtInstance(coursierPath: string) {
224224
"-Dsbt.log.noformat=true",
225225
"-classpath", sbtClasspath,
226226
"xsbt.boot.Boot"
227-
]).childProcess
227+
], {
228+
cwd: workspaceRoot
229+
})
228230

229231
// Close stdin, otherwise in case of error sbt will block waiting for the
230232
// user input to reload or exit the build.
@@ -263,8 +265,7 @@ function fetchWithCoursier(coursierPath: string, artifact: string, extra: string
263265
"-p",
264266
artifact
265267
].concat(extra)
266-
const coursierPromise = cpp.spawn("java", args)
267-
const coursierProc = coursierPromise.childProcess
268+
const coursierProc = cpp.spawn("java", args)
268269

269270
let classPath = ""
270271

@@ -283,7 +284,7 @@ function fetchWithCoursier(coursierPath: string, artifact: string, extra: string
283284
throw new Error(msg)
284285
}
285286
})
286-
return coursierPromise.then(() => { return classPath })
287+
return coursierProc.then(() => { return classPath })
287288
})
288289
}
289290

0 commit comments

Comments
 (0)