Skip to content

[BSP] - Somehow signify a no-op compilation #6103

@ckipp01

Description

@ckipp01

Following up on a quick conversation on Gitter, in Metals one of the things we check when we get notified of a build/taskStart is to see whether or not it's a no-op compilation. You can see this here:

https://github.com/scalameta/metals/blob/8f1c5db0e76ddbb95db06a55afc395ca6a965d13/metals/src/main/scala/scala/meta/internal/metals/ForwardingMetalsBuildClient.scala#L117-L148

For better or worse, we just check in the message params to see if it starts with Start no-op compilation. This is Bloop specific at the moment, and you can see where this is being reported in Bloop here:

https://github.com/scalacenter/bloop/blob/4768184cc8842d5d6773646ccda93210a89f1b05/frontend/src/main/scala/bloop/reporter/BspProjectReporter.scala#L301-L331

Within Metals we do various check on this compilation to see if we need to do certain things that can in some situations offer some nice UX and speed improvements. Just to give an example we have a Tree View of all packages, and if it's a no-op compilation we know that we don't need to compute anything new for the tree view. As state, right now this is quite Bloop specific, but it'd be great to expand this somehow so that we could have a more generic approach to know if a compilation is a no-op or not from sbt. I'd love to know if this is possible and something you'd consider to forward somehow in the build/taskStart. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ideIntelliJ or Metals integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions