scalacenter / bloop

Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool.
https://scalacenter.github.io/bloop/
Apache License 2.0
907 stars 202 forks source link

Bloop ignores excludeFilter in build.sbt #1440

Open pjoneswork opened 3 years ago

pjoneswork commented 3 years ago

As far as I can tell bloop ignores the sbt setting excludeFilter.

Simple setup:

> cat build.sbt
ThisBuild / organization := "foo"
ThisBuild / scalaVersion := "2.12.12"

lazy val root = (project in file ("."))
  .settings(
    excludeFilter := new SimpleFileFilter((f: File) =>
      f.getAbsolutePath.endsWith("bar.scala")
    )
  )

> cat src/main/scala/foo.scala
trait Foo

> cat src/main/scala/bar.scala
DOES NOT COMPILE

> cat project/build.properties
sbt.version=1.4.6

> cat project/metals.sbt
// DO NOT EDIT! This file is auto-generated.
// This file enables sbt-bloop to create bloop config files.

addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.6-15-209c2a5c")

sbt compile compiles successfully.

But I get the following error mesage in VSCode for the file bar.scala

bar.scala
 * expected class or object definition bloop [1, 1]

Is there a way to get bloop to ignore this file as well?

What I expect: No error messages in VSCode

pjoneswork commented 3 years ago
Screen Shot 2021-01-06 at 1 02 29 PM
tgodzik commented 3 years ago

Thanks for reporting! This is currently not supported as far as I can see and would most likely require the change in Bloop model. There is nothing int he configuration that corresponds to the exclude filters at present.

ssm951 commented 1 year ago

Could there be an addition to the projects object to have an excludes field with the same schema as the sources field? Or do we have another action plan with this?