Skip to content

Commit 0999f5b

Browse files
committed
sbt-dotty: Better error when code is not found
- Don't use MessageOnlyException since it can display its output twice in the sbt shell - Point to the Dotty docs on IDE support
1 parent f6c1461 commit 0999f5b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,14 @@ object DottyIDEPlugin extends AutoPlugin {
239239
runProcess(codeCommand.value ++ Seq("."), directory = baseDirectory.value)
240240
} catch {
241241
case ioex: IOException if ioex.getMessage.startsWith("""Cannot run program "code"""") =>
242-
throw new MessageOnlyException(
242+
val log = streams.value.log
243+
log.error(
243244
"""Could not find Visual Studio Code on your system.
244-
|Please download it at (https://code.visualstudio.com/) and add it to your path and then rerun launchIDE
245-
|
246-
|For Linux: https://code.visualstudio.com/docs/setup/linux
247-
|For Windows: https://code.visualstudio.com/docs/setup/windows
248-
|For Mac: https://code.visualstudio.com/docs/setup/mac""".stripMargin)
245+
|Follow the instructions at http://dotty.epfl.ch/docs/usage/ide-support.html
246+
|to install it.""".stripMargin)
247+
throw new FeedbackProvidedException {
248+
override def toString = "Could not find Visual Studio Code on your system."
249+
}
249250
}
250251
}
251252

0 commit comments

Comments
 (0)