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`
1313val `dotty-bench` = Build .`dotty-bench`
1414val `dotty-bench-bootstrapped` = Build .`dotty-bench-bootstrapped`
1515val `dotty-semanticdb` = Build .`dotty-semanticdb`
16+ val `dotty-semanticdb-input` = Build .`dotty-semanticdb-input`
1617val `scala-library` = Build .`scala-library`
1718val `scala-compiler` = Build .`scala-compiler`
1819val `scala-reflect` = Build .`scala-reflect`
Original file line number Diff line number Diff line change @@ -919,6 +919,11 @@ object Build {
919919 lazy val `dotty-bench-bootstrapped` = project.in(file(" bench" )).asDottyBench(Bootstrapped )
920920
921921 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+ )
922927
923928 // Depend on dotty-library so that sbt projects using dotty automatically
924929 // depend on the dotty-library
@@ -1317,6 +1322,7 @@ object Build {
13171322 enablePlugins(JmhPlugin )
13181323
13191324 def asDottySemanticdb (implicit mode : Mode ): Project = project.withCommonSettings.
1325+ aggregate(`dotty-semanticdb-input`).
13201326 dependsOn(dottyCompiler).
13211327 settings(semanticdbSettings)
13221328
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import scala.collection.JavaConverters._
77import dotty .tools .dotc .util .SourceFile
88
99object Semanticdbs {
10-
10+ private val buildSubFolder = " semanticdb/input/ "
1111 /**
1212 * Utility to load SemanticDB for Scala source files.
1313 *
@@ -17,7 +17,7 @@ object Semanticdbs {
1717 * if you only care about reading SemanticDB files from a single project.
1818 */
1919 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)
2121 private val classLoader = new java.net.URLClassLoader (classpath.map(_.toUri.toURL).toArray)
2222 /** Returns a SemanticDB for a single Scala source file, if any. The path must be absolute. */
2323 def resolve (scalaAbsolutePath : Path ): Option [s.TextDocument ] = {
@@ -43,7 +43,7 @@ object Semanticdbs {
4343 scalaRelativePath : Path ,
4444 semanticdbAbsolutePath : Path
4545 ): s.TextDocument = {
46- val reluri = scalaRelativePath.iterator.asScala.mkString(" /" )
46+ val reluri = buildSubFolder + scalaRelativePath.iterator.asScala.mkString(" /" )
4747 val sdocs = parseTextDocuments(semanticdbAbsolutePath)
4848 sdocs.documents.find(_.uri == reluri) match {
4949 case None => throw new NoSuchElementException (reluri)
You can’t perform that action at this time.
0 commit comments