Skip to content

Commit 7bea59e

Browse files
committed
Address review
1 parent cf2c367 commit 7bea59e

File tree

2 files changed

+14
-27
lines changed

2 files changed

+14
-27
lines changed

vscode-dotty/src/extension.ts

Lines changed: 14 additions & 13 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 'promisify-child-process';
6+
import * as pcp from 'promisify-child-process';
77
import * as compareVersions from 'compare-versions';
88

99
import { ChildProcess } from "child_process";
@@ -39,11 +39,10 @@ const sbtBuildPropertiesFile = path.join(sbtProjectDir, "build.properties")
3939
const sbtBuildSbtFile = path.join(workspaceRoot, "build.sbt")
4040
const languageServerArtifactFile = path.join(workspaceRoot, ".dotty-ide-artifact")
4141

42-
function isUnconfiguredProject() {
43-
return !( fs.existsSync(disableDottyIDEFile)
44-
|| fs.existsSync(sbtPluginFile)
45-
|| fs.existsSync(sbtBuildPropertiesFile)
46-
|| fs.existsSync(sbtBuildSbtFile)
42+
function isConfiguredProject() {
43+
return ( fs.existsSync(sbtPluginFile)
44+
|| fs.existsSync(sbtBuildPropertiesFile)
45+
|| fs.existsSync(sbtBuildSbtFile)
4746
)
4847
}
4948

@@ -83,7 +82,7 @@ export function activate(context: ExtensionContext) {
8382

8483
} else {
8584
let configuredProject: Thenable<void> = Promise.resolve()
86-
if (isUnconfiguredProject()) {
85+
if (!isConfiguredProject()) {
8786
configuredProject = vscode.window.showInformationMessage(
8887
"This looks like an unconfigured Scala project. Would you like to start the Dotty IDE?",
8988
"Yes", "No"
@@ -98,10 +97,12 @@ export function activate(context: ExtensionContext) {
9897
})
9998
}
10099

101-
configuredProject
102-
.then(_ => connectToSbt(coursierPath))
103-
.then(sbt => withProgress("Configuring Dotty IDE...", configureIDE(sbt)))
104-
.then(_ => runLanguageServer(coursierPath, languageServerArtifactFile))
100+
if (!fs.existsSync(disableDottyIDEFile)) {
101+
configuredProject
102+
.then(_ => connectToSbt(coursierPath))
103+
.then(sbt => withProgress("Configuring Dotty IDE...", configureIDE(sbt)))
104+
.then(_ => runLanguageServer(coursierPath, languageServerArtifactFile))
105+
}
105106
}
106107
}
107108

@@ -220,7 +221,7 @@ function runLanguageServer(coursierPath: string, languageServerArtifactFile: str
220221

221222
function startNewSbtInstance(coursierPath: string) {
222223
fetchWithCoursier(coursierPath, sbtArtifact).then((sbtClasspath) => {
223-
sbtProcess = cpp.spawn("java", [
224+
sbtProcess = pcp.spawn("java", [
224225
"-Dsbt.log.noformat=true",
225226
"-classpath", sbtClasspath,
226227
"xsbt.boot.Boot"
@@ -265,7 +266,7 @@ function fetchWithCoursier(coursierPath: string, artifact: string, extra: string
265266
"-p",
266267
artifact
267268
].concat(extra)
268-
const coursierProc = cpp.spawn("java", args)
269+
const coursierProc = pcp.spawn("java", args)
269270

270271
let classPath = ""
271272

vscode-dotty/src/types.d.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)