|
3 | 3 | import * as fs from 'fs'; |
4 | 4 | import * as path from 'path'; |
5 | 5 |
|
6 | | -import * as cpp from 'promisify-child-process'; |
| 6 | +import * as pcp from 'promisify-child-process'; |
7 | 7 | import * as compareVersions from 'compare-versions'; |
8 | 8 |
|
9 | 9 | import { ChildProcess } from "child_process"; |
@@ -39,11 +39,10 @@ const sbtBuildPropertiesFile = path.join(sbtProjectDir, "build.properties") |
39 | 39 | const sbtBuildSbtFile = path.join(workspaceRoot, "build.sbt") |
40 | 40 | const languageServerArtifactFile = path.join(workspaceRoot, ".dotty-ide-artifact") |
41 | 41 |
|
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) |
47 | 46 | ) |
48 | 47 | } |
49 | 48 |
|
@@ -81,9 +80,9 @@ export function activate(context: ExtensionContext) { |
81 | 80 | }, false) |
82 | 81 | }) |
83 | 82 |
|
84 | | - } else { |
| 83 | + } else if (!fs.existsSync(disableDottyIDEFile)) { |
85 | 84 | let configuredProject: Thenable<void> = Promise.resolve() |
86 | | - if (isUnconfiguredProject()) { |
| 85 | + if (!isConfiguredProject()) { |
87 | 86 | configuredProject = vscode.window.showInformationMessage( |
88 | 87 | "This looks like an unconfigured Scala project. Would you like to start the Dotty IDE?", |
89 | 88 | "Yes", "No" |
@@ -220,7 +219,7 @@ function runLanguageServer(coursierPath: string, languageServerArtifactFile: str |
220 | 219 |
|
221 | 220 | function startNewSbtInstance(coursierPath: string) { |
222 | 221 | fetchWithCoursier(coursierPath, sbtArtifact).then((sbtClasspath) => { |
223 | | - sbtProcess = cpp.spawn("java", [ |
| 222 | + sbtProcess = pcp.spawn("java", [ |
224 | 223 | "-Dsbt.log.noformat=true", |
225 | 224 | "-classpath", sbtClasspath, |
226 | 225 | "xsbt.boot.Boot" |
@@ -265,7 +264,7 @@ function fetchWithCoursier(coursierPath: string, artifact: string, extra: string |
265 | 264 | "-p", |
266 | 265 | artifact |
267 | 266 | ].concat(extra) |
268 | | - const coursierProc = cpp.spawn("java", args) |
| 267 | + const coursierProc = pcp.spawn("java", args) |
269 | 268 |
|
270 | 269 | let classPath = "" |
271 | 270 |
|
|
0 commit comments