From 97d2f239f78cd7be3893c9a2a7e3afbf0b8061cf Mon Sep 17 00:00:00 2001 From: Krzysztof Romanowski Date: Wed, 9 Feb 2022 21:30:19 +0100 Subject: [PATCH] Force correct source root for semantic db --- project/settings.sc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/settings.sc b/project/settings.sc index 82d02b27ce..fd62da8fea 100644 --- a/project/settings.sc +++ b/project/settings.sc @@ -721,6 +721,8 @@ trait ScalaCliCompile extends ScalaModule { val proc = os.proc( Seq("scala-cli", "compile", "--classpath"), + if (scalaVersion().startsWith("3")) Nil + else Seq("-O", s"-P:semanticdb:sourceroot:${os.pwd}"), Seq("-S", scalaVersion()), asOpt(scalacOptions(), "-O"), asOpt(compileClasspath().map(_.path), "--jar"), @@ -731,6 +733,7 @@ trait ScalaCliCompile extends ScalaModule { val compile = proc.call() val out = compile.out.trim + os.Path(out.split(File.pathSeparator).head) }