Skip to content

Commit 8a48286

Browse files
committed
Address review comments
1 parent aadb30f commit 8a48286

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

project/Build.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,14 +980,13 @@ object Build {
980980
val defaultIDEConfig = baseDirectory.value / "out" / "default-dotty-ide-config"
981981
IO.write(defaultIDEConfig, dottyVersion)
982982
val dottyPluginSbtFile = baseDirectory.value / "out" / "dotty-plugin.sbt"
983-
IO.write(dottyPluginSbtFile, s"""addSbtPlugin("$dottyOrganization" % $sbtDottyName % "$sbtDottyVersion")""")
983+
IO.write(dottyPluginSbtFile, s"""addSbtPlugin("$dottyOrganization" % "$sbtDottyName" % "$sbtDottyVersion")""")
984984
Seq(defaultIDEConfig, dottyPluginSbtFile)
985985
},
986986
compile in Compile := Def.task {
987987
val workingDir = baseDirectory.value
988988
val coursier = workingDir / "out" / "coursier"
989989
val packageJson = workingDir / "package.json"
990-
// val _ = (managedResources in Compile).value
991990
if (!coursier.exists || packageJson.lastModified > coursier.lastModified)
992991
runProcess(Seq("npm", "install"), wait = true, directory = workingDir)
993992
val tsc = workingDir / "node_modules" / ".bin" / "tsc"

vscode-dotty/src/extension.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ export function activate(context: ExtensionContext) {
1616
extensionContext = context
1717
outputChannel = vscode.window.createOutputChannel('Dotty Language Client');
1818

19-
const sbtArtifact = "org.scala-sbt:sbt-launch:1.2.0"
19+
const sbtArtifact = "org.scala-sbt:sbt-launch:1.2.3"
2020
const buildSbtFile = `${vscode.workspace.rootPath}/build.sbt`
2121
const dottyPluginSbtFile = path.join(extensionContext.extensionPath, './out/dotty-plugin.sbt')
22+
const disableDottyIDEFile = `${vscode.workspace.rootPath}/.dotty-ide-disabled`
2223
const languageServerArtifactFile = `${vscode.workspace.rootPath}/.dotty-ide-artifact`
2324
const languageServerDefaultConfigFile = path.join(extensionContext.extensionPath, './out/default-dotty-ide-config')
2425
const coursierPath = path.join(extensionContext.extensionPath, './out/coursier');
@@ -42,9 +43,9 @@ export function activate(context: ExtensionContext) {
4243
// otherwise, try propose to start it if there's no build.sbt
4344
if (fs.existsSync(languageServerArtifactFile)) {
4445
runLanguageServer(coursierPath, languageServerArtifactFile)
45-
} else if (!fs.existsSync(buildSbtFile)) {
46+
} else if (!fs.existsSync(disableDottyIDEFile) && !fs.existsSync(buildSbtFile)) {
4647
vscode.window.showInformationMessage(
47-
"This looks like an unconfigured project. Would you like to start Dotty IDE?",
48+
"This looks like an unconfigured Scala project. Would you like to start the Dotty IDE?",
4849
"Yes", "No"
4950
).then(choice => {
5051
if (choice == "Yes") {
@@ -57,6 +58,8 @@ export function activate(context: ExtensionContext) {
5758
})
5859
}
5960
})
61+
} else {
62+
fs.appendFile(disableDottyIDEFile, "", _ => {})
6063
}
6164
})
6265
}
@@ -118,7 +121,7 @@ function fetchWithCoursier(coursierPath: string, artifact: string, extra: string
118121
function configureIDE(sbtClasspath: string, languageServerScalaVersion: string, dottyPluginSbtFile: string) {
119122
return vscode.window.withProgress({
120123
location: vscode.ProgressLocation.Window,
121-
title: 'Configuring IDE...'
124+
title: 'Configuring the IDE for Dotty...'
122125
}, (progress) => {
123126

124127
// Run sbt to configure the IDE. If the `DottyPlugin` is not present, dynamically load it and

0 commit comments

Comments
 (0)