IntelliJ IDEA 2019.2 Help

BSP support

The Build Server Protocol (BSP) defines a standard way for the build tool such as sbt or Mill to interact with IDEs, letting you import your project, run compilation and other tasks, get error messages and progress updates directly in the IDE.

The Scala plugin for IntelliJ IDEA supports BSP as a client.

Before you start

Make sure you have completed the following steps:

  1. You have downloaded the Java version 8 and the Python version 2 or 3 on your machine.

  2. You have downloaded and set up the Bloop server on your machine as described in the Bloop installation guide.

Export your build to Bloop

Once the Bloop server is set up, you need to manually install the Bloop plugin inside your sbt project and export your build to Bloop.

  1. Create a new or open an existing sbt project.

  2. In the Project tool window, right-click the project directory, select New | File.

    project source root

  3. In the New File dialog, enter plugins.sbt and click OK.

    New File dialog

  4. Open the plugins.sbt file in the editor and add the following command:

    addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.3.2")

  5. Start the sbt shell or reload if it is already opened and enter the following command:

    bloopInstall
    bloopInstall command

  6. Press Enter.

    IntelliJ IDEA generates the appropriate configuration.

    sbt shell result
  7. Close the project.

Import an sbt project from the bsp model

After you have exported your build to Bloop, you can import your project using bsp.

  1. Click Import Project or Open on the welcome screen.

  2. In the dialog that opens, select a directory that contains your sbt project.

  3. On the page that opens, select the bsp option and click Next.

    bsp import model

  4. On the page that opens, in the Bloop executable field, make sure you have specified the absolute path to the location of the bloop executable.

    Bloop import

  5. Click Finish.

    IntelliJ IDEA imports the project. The bsp tool window displays the imported project and its dependencies.

    bsp downloaded project
Last modified: 23 August 2019