Skip to content

Commit

Permalink
setup-ide: look into .bsp folder before moving it out of the way
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg committed Jul 15, 2022
1 parent e947cb9 commit bb22677
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions bleep-cli/src/scala/bleep/commands/SetupIde.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,20 @@ case class SetupIde(buildPaths: BuildPaths, logger: Logger, maybeSelectedProject

List(
// remove other configured BSP tools
buildPaths.buildDir / ".bsp",
Option(buildPaths.buildDir / ".bsp").filter { p =>
if (Files.isDirectory(p)) {
Files.list(p).toList.asScala.toList match {
case one :: Nil if one.getFileName.toString == "bleep.json" => false
case _ => true
}
} else true
},
// causes intellij to always pick sbt BSP import
buildPaths.buildDir / ".bloop",
Some(buildPaths.buildDir / ".bloop").filter(FileUtils.exists),
// cause metals to always pick sbt BSP import
buildPaths.buildDir / "build.sbt",
buildPaths.buildDir / "project"
).filter(FileUtils.exists) match {
Some(buildPaths.buildDir / "build.sbt").filter(FileUtils.exists),
Some(buildPaths.buildDir / "project").filter(FileUtils.exists)
).flatten match {
case Nil => ()
case conflicts =>
LazyList
Expand Down

0 comments on commit bb22677

Please sign in to comment.