diff --git a/docs/_docs/contributing/setting-up-your-ide.md b/docs/_docs/contributing/setting-up-your-ide.md index a02c1dee63cb..a15bf651ef74 100644 --- a/docs/_docs/contributing/setting-up-your-ide.md +++ b/docs/_docs/contributing/setting-up-your-ide.md @@ -3,16 +3,15 @@ layout: doc-page title: Setting up your IDE --- -You can use either Metals with your favorite editor (VS Code, Neovim, Sublime) -or [IntelliJ IDEA for -Scala](https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html) +You can use either Metals with your favorite editor or +[IntelliJ IDEA for Scala](https://www.jetbrains.com/help/idea/discover-intellij-idea-for-scala.html) to work on the Scala 3 codebase. There are however a few additional considerations to take into account. ## Bootstrapping Projects -The sbt build for dotty implements bootstrapping within the same build, so each component has -two projects: +The sbt build for dotty implements bootstrapping within the same build, so each +component has two projects: ``` sbt:scala3> projects @@ -33,9 +32,9 @@ you'll actually want these modules exported. In order to achieve this you'll want to make sure you do two things: 1. You'll want to find and change the following under - `commonBootstrappedSettings` which is found in the - [`Build.scala`](https://github.com/scala/scala3/blob/main/project/Build.scala) - file. + `commonBootstrappedSettings` which is found in the + [`Build.scala`](https://github.com/scala/scala3/blob/main/project/Build.scala) + file. ```diff @@ -43,12 +42,13 @@ want to make sure you do two things: + bspEnabled := true, ``` -2. Set `sbt` as your build server instead of the default, Bloop. You can achieve - this with the `Metals: Switch Build Server` command and then choosing sbt. In - VSCode, this looks like this: +2. Run `sbt publishLocal` to get the needed presentation compiler jars. -![bsp-switch](https://user-images.githubusercontent.com/777748/241986423-0724ae74-0ebd-42ef-a1b7-4d17678992b4.png) +By default Metals uses Bloop build server, however you can also use sbt +directly. You can achieve this with the `Metals: Switch Build Server` command +and then choosing sbt. In VSCode, this looks like this: +![bsp-switch](https://user-images.githubusercontent.com/777748/241986423-0724ae74-0ebd-42ef-a1b7-4d17678992b4.png) ### IntelliJ diff --git a/project/Build.scala b/project/Build.scala index 84ce00d11577..6ec933a599b3 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -469,8 +469,8 @@ object Build { } // Settings used when compiling dotty with a non-bootstrapped dotty - lazy val commonBootstrappedSettings = commonDottySettings ++ NoBloopExport.settings ++ Seq( - // To enable support of scaladoc and language-server projects you need to change this to true and use sbt as your build server + lazy val commonBootstrappedSettings = commonDottySettings ++ Seq( + // To enable support of scaladoc and language-server projects you need to change this to true bspEnabled := false, (Compile / unmanagedSourceDirectories) += baseDirectory.value / "src-bootstrapped", diff --git a/project/NoBloopExport.scala b/project/NoBloopExport.scala deleted file mode 100644 index 7a088a405781..000000000000 --- a/project/NoBloopExport.scala +++ /dev/null @@ -1,31 +0,0 @@ -import sbt._ -import Keys._ - -/* With <3 from scala-js */ -object NoBloopExport { - private lazy val bloopGenerateKey: Option[TaskKey[Result[Option[File]]]] = { - val optBloopKeysClass: Option[Class[_]] = try { - Some(Class.forName("bloop.integrations.sbt.BloopKeys")) - } catch { - case _: ClassNotFoundException => None - } - - optBloopKeysClass.map { bloopKeysClass => - val bloopGenerateGetter = bloopKeysClass.getMethod("bloopGenerate") - bloopGenerateGetter.invoke(null).asInstanceOf[TaskKey[Result[Option[File]]]] - } - } - - /** Settings to prevent the project from being exported to IDEs. */ - lazy val settings: Seq[Setting[_]] = { - bloopGenerateKey match { - case None => - Nil - case Some(key) => - Seq( - Compile / key := Value(None), - Test / key := Value(None), - ) - } - } -}