Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: Remove workaround for Bloop and update docs #21842

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/_docs/contributing/setting-up-your-ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,23 +31,24 @@ Normally this is fine, but if you're working on certain modules like `scaladoc`
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.
1. You'll want to find and change the following above
`commonBootstrappedSettings` which is found in the
[`Build.scala`](https://github.com/scala/scala3/blob/main/project/Build.scala)
file.

```diff

- bspEnabled := false,
+ bspEnabled := true,
- val enableBspAllProjects = false,
+ val enableBspAllProjects = 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

Expand Down
16 changes: 13 additions & 3 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,20 @@ object Build {
) ++ extMap
}

/* This projects are irrelevant from IDE point of view and do not compile with Bloop*/
tgodzik marked this conversation as resolved.
Show resolved Hide resolved
val fullyDisabledProjects = Set(
"scala2-library-cc",
"scala2-library-bootstrapped",
"scala2-library-cc-tasty",
"scala2-library-tasty"
)

val enableBspAllProjects = false

// 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
bspEnabled := false,
lazy val commonBootstrappedSettings = commonDottySettings ++ Seq(
// To enable support of scaladoc and language-server projects you need to change this to true
bspEnabled := { if(fullyDisabledProjects(name.value)) false else enableBspAllProjects },
(Compile / unmanagedSourceDirectories) += baseDirectory.value / "src-bootstrapped",

version := dottyVersion,
Expand Down
31 changes: 0 additions & 31 deletions project/NoBloopExport.scala

This file was deleted.

Loading