File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
semanticdb/test/dotty/semanticdb Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ val `dotty-language-server` = Build.`dotty-language-server`
13
13
val `dotty-bench` = Build .`dotty-bench`
14
14
val `dotty-bench-bootstrapped` = Build .`dotty-bench-bootstrapped`
15
15
val `dotty-semanticdb` = Build .`dotty-semanticdb`
16
+ val `dotty-semanticdb-input` = Build .`dotty-semanticdb-input`
16
17
val `scala-library` = Build .`scala-library`
17
18
val `scala-compiler` = Build .`scala-compiler`
18
19
val `scala-reflect` = Build .`scala-reflect`
Original file line number Diff line number Diff line change @@ -919,6 +919,11 @@ object Build {
919
919
lazy val `dotty-bench-bootstrapped` = project.in(file(" bench" )).asDottyBench(Bootstrapped )
920
920
921
921
lazy val `dotty-semanticdb` = project.in(file(" semanticdb" )).asDottySemanticdb(Bootstrapped )
922
+ lazy val `dotty-semanticdb-input` = project.in(file(" semanticdb/input" )).settings(
923
+ scalaVersion := " 2.12.7" ,
924
+ scalacOptions += " -Yrangepos" ,
925
+ addCompilerPlugin(" org.scalameta" % " semanticdb-scalac" % " 4.0.0" cross CrossVersion .full)
926
+ )
922
927
923
928
// Depend on dotty-library so that sbt projects using dotty automatically
924
929
// depend on the dotty-library
@@ -1317,6 +1322,7 @@ object Build {
1317
1322
enablePlugins(JmhPlugin )
1318
1323
1319
1324
def asDottySemanticdb (implicit mode : Mode ): Project = project.withCommonSettings.
1325
+ aggregate(`dotty-semanticdb-input`).
1320
1326
dependsOn(dottyCompiler).
1321
1327
settings(semanticdbSettings)
1322
1328
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import scala.collection.JavaConverters._
7
7
import dotty .tools .dotc .util .SourceFile
8
8
9
9
object Semanticdbs {
10
-
10
+ private val buildSubFolder = " semanticdb/input/ "
11
11
/**
12
12
* Utility to load SemanticDB for Scala source files.
13
13
*
@@ -17,7 +17,7 @@ object Semanticdbs {
17
17
* if you only care about reading SemanticDB files from a single project.
18
18
*/
19
19
class Loader (sourceroot : Path , classpath : List [Path ]) {
20
- private val META_INF = Paths .get(" META-INF" , " semanticdb" )
20
+ private val META_INF = Paths .get(" META-INF" , " semanticdb" ).resolve(buildSubFolder)
21
21
private val classLoader = new java.net.URLClassLoader (classpath.map(_.toUri.toURL).toArray)
22
22
/** Returns a SemanticDB for a single Scala source file, if any. The path must be absolute. */
23
23
def resolve (scalaAbsolutePath : Path ): Option [s.TextDocument ] = {
@@ -43,7 +43,7 @@ object Semanticdbs {
43
43
scalaRelativePath : Path ,
44
44
semanticdbAbsolutePath : Path
45
45
): s.TextDocument = {
46
- val reluri = scalaRelativePath.iterator.asScala.mkString(" /" )
46
+ val reluri = buildSubFolder + scalaRelativePath.iterator.asScala.mkString(" /" )
47
47
val sdocs = parseTextDocuments(semanticdbAbsolutePath)
48
48
sdocs.documents.find(_.uri == reluri) match {
49
49
case None => throw new NoSuchElementException (reluri)
You can’t perform that action at this time.
0 commit comments