Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lefou committed Aug 12, 2022
1 parent 7793dbf commit 5f8fb71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bsp/src/mill/bsp/MillBuildServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class MillBuildServer(
val params = TaskParameters.fromCompileParams(p)
val taskId = params.hashCode()
val compileTasks = params.getTargets.distinct.map(bspModulesById).map {
case m: SemanticDbScalaModule if clientWantsSemanticDb => m.compileClassAndSemanticDbFiles
case m: SemanticDbScalaModule if clientWantsSemanticDb => m.compiledClassesAndSemanticDbFiles
case m: JavaModule => m.compile
case m => T.task {
Result.Failure(
Expand Down
12 changes: 6 additions & 6 deletions scalalib/src/mill/scalalib/SemanticDbScalaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ trait SemanticDbScalaModule extends JavaModule { hostModule =>
}
}

def compileClassAndSemanticDbFiles = T {
def compiledClassesAndSemanticDbFiles = T {
val dest = T.dest
val classes = compile().classes.path
val sems = semanticDbData().path
Expand All @@ -116,20 +116,20 @@ trait SemanticDbScalaModule extends JavaModule { hostModule =>
) {
T {
T.log.debug(
s"compileClassAndSemanticDbFiles target was not overridden, assuming hard-coded classes directory for target ${compileClassAndSemanticDbFiles}"
s"compileClassAndSemanticDbFiles target was not overridden, assuming hard-coded classes directory for target ${compiledClassesAndSemanticDbFiles}"
)
UnresolvedPath.DestPath(
os.sub,
compileClassAndSemanticDbFiles.ctx.segments,
compileClassAndSemanticDbFiles.ctx.foreign
compiledClassesAndSemanticDbFiles.ctx.segments,
compiledClassesAndSemanticDbFiles.ctx.foreign
)
}
} else {
T {
T.log.debug(
s"compileClassAndSemanticDbFiles target was overridden, need to actually execute compilation to get the compiled classes directory for target ${compileClassAndSemanticDbFiles}"
s"compileClassAndSemanticDbFiles target was overridden, need to actually execute compilation to get the compiled classes directory for target ${compiledClassesAndSemanticDbFiles}"
)
UnresolvedPath.ResolvedPath(compileClassAndSemanticDbFiles().path)
UnresolvedPath.ResolvedPath(compiledClassesAndSemanticDbFiles().path)
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions scalalib/src/mill/scalalib/bsp/BspModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ object BspUri {
* @param outerCtx0
*/
@internal
trait MillBuildTarget // (rootModule: BaseModule, ctx0: mill.define.Ctx)
extends // Module()(ctx0) with
ScalaModule {
trait MillBuildTarget
extends ScalaModule {
protected def rootModule: BaseModule
override def millSourcePath: os.Path = rootModule.millSourcePath
override def scalaVersion: T[String] = BuildInfo.scalaVersion
Expand Down Expand Up @@ -143,7 +142,7 @@ trait MillBuildTarget // (rootModule: BaseModule, ctx0: mill.define.Ctx)
CompilationResult(T.dest / "dummy", PathRef(T.dest / "classes"))
}

override def semanticDbData: T[PathRef] = T{
override def semanticDbData: T[PathRef] = T {
T.log.errorStream.println(s"semanticDbData: ${T.dest}")
PathRef(T.dest)
}
Expand Down

0 comments on commit 5f8fb71

Please sign in to comment.