diff --git a/tests/unit/src/main/scala/tests/TestingServer.scala b/tests/unit/src/main/scala/tests/TestingServer.scala index 6ef45b26d7e..53125f90d79 100644 --- a/tests/unit/src/main/scala/tests/TestingServer.scala +++ b/tests/unit/src/main/scala/tests/TestingServer.scala @@ -190,8 +190,10 @@ final class TestingServer( if (isSameFile) { s"L${location.getRange.getStart.getLine}" } else { - val filename = location.getUri.toAbsolutePath.toNIO.getFileName - s"$filename:${location.getRange.getStart.getLine}" + val path = location.getUri.toAbsolutePath + val filename = path.toNIO.getFileName + if (path.isDependencySource(workspace)) filename.toString + else s"$filename:${location.getRange.getStart.getLine}" } } val occurrence = token match { diff --git a/tests/unit/src/test/scala/tests/DefinitionSlowSuite.scala b/tests/unit/src/test/scala/tests/DefinitionSlowSuite.scala index 8c90c1d2417..0e290441933 100644 --- a/tests/unit/src/test/scala/tests/DefinitionSlowSuite.scala +++ b/tests/unit/src/test/scala/tests/DefinitionSlowSuite.scala @@ -65,25 +65,24 @@ object DefinitionSlowSuite extends BaseSlowSuite("definition") { _ = assertNoDiff(client.workspaceDiagnostics, "") _ = assertNoDiff( server.workspaceDefinitions, - """| - |/a/src/main/scala/a/Main.scala + """|/a/src/main/scala/a/Main.scala |package a - |import java.util.concurrent.Future/*Future.java:95*/ // unused - |import scala.util.Failure/*Try.scala:213*/ // unused - |object Main/*L3*/ extends App/*App.scala:38*/ { + |import java.util.concurrent.Future/*Future.java*/ // unused + |import scala.util.Failure/*Try.scala*/ // unused + |object Main/*L3*/ extends App/*App.scala*/ { | val message/*L4*/ = Message/*Message.java:1*/.message/*Message.java:2*/ - | new java.io.PrintStream/*PrintStream.java:56*/(new java.io.ByteArrayOutputStream/*ByteArrayOutputStream.java:44*/()) - | println/*Predef.scala:396*/(message/*L4*/) + | new java.io.PrintStream/*PrintStream.java*/(new java.io.ByteArrayOutputStream/*ByteArrayOutputStream.java*/()) + | println/*Predef.scala*/(message/*L4*/) |} |/b/src/main/scala/a/MainSuite.scala |package a - |import java.util.concurrent.Future/*Future.java:95*/ // unused - |import scala.util.Failure/*Try.scala:213*/ // unused - |import org.scalatest.FunSuite/*FunSuite.scala:1559*/ - |object MainSuite/*L4*/ extends FunSuite/*FunSuite.scala:1559*/ { - | test/*FunSuiteLike.scala:119*/("a") { - | val condition/*L6*/ = Main/*Main.scala:3*/.message/*Main.scala:4*/.contains/*String.java:2131*/("Hello") - | assert/*Assertions.scala:414*/(condition/*L6*/) + |import java.util.concurrent.Future/*Future.java*/ // unused + |import scala.util.Failure/*Try.scala*/ // unused + |import org.scalatest.FunSuite/*FunSuite.scala*/ + |object MainSuite/*L4*/ extends FunSuite/*FunSuite.scala*/ { + | test/*FunSuiteLike.scala*/("a") { + | val condition/*L6*/ = Main/*Main.scala:3*/.message/*Main.scala:4*/.contains/*String.java*/("Hello") + | assert/*Assertions.scala*/(condition/*L6*/) | } |} |""".stripMargin @@ -101,29 +100,28 @@ object DefinitionSlowSuite extends BaseSlowSuite("definition") { // - old references to `message` don't resolve because it has been renamed to `helloMessage` // - new references to like `testName` don't resolve server.workspaceDefinitions, - """| - |/a/src/main/scala/a/Main.scala + """|/a/src/main/scala/a/Main.scala |>>>>>>>/**/ | |package a - |import java.util.concurrent.Future/*Future.java:95*/ // unused - |import scala.util.Failure/*Try.scala:213*/ // unused - |object Main/*L5*/ extends App/*App.scala:38*/ { + |import java.util.concurrent.Future/*Future.java*/ // unused + |import scala.util.Failure/*Try.scala*/ // unused + |object Main/*L5*/ extends App/*App.scala*/ { | val helloMessage/**/ = Message/*Message.java:1*/.message/*Message.java:2*/ - | new java.io.PrintStream/*PrintStream.java:56*/(new java.io.ByteArrayOutputStream/*ByteArrayOutputStream.java:44*/()) - | println/*Predef.scala:396*/(message/**/) + | new java.io.PrintStream/*PrintStream.java*/(new java.io.ByteArrayOutputStream/*ByteArrayOutputStream.java*/()) + | println/*Predef.scala*/(message/**/) |} |/b/src/main/scala/a/MainSuite.scala |>>>>>>>/**/ | |package a - |import java.util.concurrent.Future/*Future.java:95*/ // unused - |import scala.util.Failure/*Try.scala:213*/ // unused - |import org.scalatest.FunSuite/*FunSuite.scala:1559*/ - |object MainSuite/*L6*/ extends FunSuite/*FunSuite.scala:1559*/ { - | test/*FunSuiteLike.scala:119*/(testName/**/) { - | val condition/*L8*/ = Main/*Main.scala:5*/.message/**/.contains/*String.java:2131*/("Hello") - | assert/*Assertions.scala:414*/(condition/*L8*/) + |import java.util.concurrent.Future/*Future.java*/ // unused + |import scala.util.Failure/*Try.scala*/ // unused + |import org.scalatest.FunSuite/*FunSuite.scala*/ + |object MainSuite/*L6*/ extends FunSuite/*FunSuite.scala*/ { + | test/*FunSuiteLike.scala*/(testName/**/) { + | val condition/*L8*/ = Main/*Main.scala:5*/.message/**/.contains/*String.java*/("Hello") + | assert/*Assertions.scala*/(condition/*L8*/) | } |} |""".stripMargin @@ -167,12 +165,12 @@ object DefinitionSlowSuite extends BaseSlowSuite("definition") { |/** | * Must obey the laws defined in cats.laws.ContravariantLaws. | */ - |@typeclass/**/ trait Contravariant/*L5*/[F/*L5*/[_]] extends Invariant/*Invariant.scala:7*/[F/*L5*/] { self/*L5*/ => + |@typeclass/**/ trait Contravariant/*L5*/[F/*L5*/[_]] extends Invariant/*Invariant.scala*/[F/*L5*/] { self/*L5*/ => | def contramap/*L6*/[A/*L6*/, B/*L6*/](fa/*L6*/: F/*L5*/[A/*L6*/])(f/*L6*/: B/*L6*/ => A/*L6*/): F/*L5*/[B/*L6*/] | override def imap/*L7*/[A/*L7*/, B/*L7*/](fa/*L7*/: F/*L5*/[A/*L7*/])(f/*L7*/: A/*L7*/ => B/*L7*/)(fi/*L7*/: B/*L7*/ => A/*L7*/): F/*L5*/[B/*L7*/] = contramap/*L6*/(fa/*L7*/)(fi/*L7*/) | - | def compose/*L9*/[G/*L9*/[_]: Contravariant/*L5*/]: Functor/*Functor.scala:11*/[λ/**/[α/**/ => F/**/[G/**/[α/**/]]]] = - | new ComposedContravariant/*Composed.scala:107*/[F/*L5*/, G/*L9*/] { + | def compose/*L9*/[G/*L9*/[_]: Contravariant/*L5*/]: Functor/*Functor.scala*/[λ/**/[α/**/ => F/**/[G/**/[α/**/]]]] = + | new ComposedContravariant/*Composed.scala*/[F/*L5*/, G/*L9*/] { | val F/*L11*/ = self/*L5*/ | val G/*L12*/ = Contravariant/**/[G/*L9*/] | } @@ -185,18 +183,18 @@ object DefinitionSlowSuite extends BaseSlowSuite("definition") { | | def liftContravariant/*L21*/[A/*L21*/, B/*L21*/](f/*L21*/: A/*L21*/ => B/*L21*/): F/*L5*/[B/*L21*/] => F/*L5*/[A/*L21*/] = contramap/*L6*/(_: F/*L5*/[B/*L21*/])(f/*L21*/) | - | override def composeFunctor/*L23*/[G/*L23*/[_]: Functor/*Functor.scala:11*/]: Contravariant/*L5*/[λ/**/[α/**/ => F/**/[G/**/[α/**/]]]] = - | new ComposedContravariantCovariant/*Composed.scala:115*/[F/*L5*/, G/*L23*/] { + | override def composeFunctor/*L23*/[G/*L23*/[_]: Functor/*Functor.scala*/]: Contravariant/*L5*/[λ/**/[α/**/ => F/**/[G/**/[α/**/]]]] = + | new ComposedContravariantCovariant/*Composed.scala*/[F/*L5*/, G/*L23*/] { | val F/*L25*/ = self/*L5*/ - | val G/*L26*/ = Functor/*Functor.scala:11*/[G/*L23*/] + | val G/*L26*/ = Functor/*Functor.scala*/[G/*L23*/] | } |} | |/a/src/main/scala/a/Main.scala |import cats._ - |import cats.implicits/*implicits.scala:2*/._ + |import cats.implicits/*implicits.scala*/._ |object Main/*L2*/ { - | println/*Predef.scala:396*/(Contravariant/*Contravariant.scala:5*/[Show/*Show.scala:9*/]) + | println/*Predef.scala*/(Contravariant/*Contravariant.scala*/[Show/*Show.scala*/]) |} """.stripMargin ) @@ -278,11 +276,10 @@ object DefinitionSlowSuite extends BaseSlowSuite("definition") { _ <- server.didOpen("a/src/main/scala/a/Main.scala") _ = assertNoDiff( server.workspaceDefinitions, - """ - |/a/src/main/scala/a/Main.scala - |object Main/*L0*/ { - | val x/*L1*/: Int/*Int.scala:21*/ = math.max/*package.scala:191*/(1, 2) - |} + """|/a/src/main/scala/a/Main.scala + |object Main/*L0*/ { + | val x/*L1*/: Int/*Int.scala*/ = math.max/*package.scala*/(1, 2) + |} """.stripMargin ) _ <- server.didSave("a/src/main/scala/a/Main.scala")( @@ -292,7 +289,7 @@ object DefinitionSlowSuite extends BaseSlowSuite("definition") { server.workspaceDefinitions, """|/a/src/main/scala/a/Main.scala |object Main/*L0*/ { - | val x/*L1*/: Int/*Int.scala:21*/ = math.max/*package.scala:191*/ + | val x/*L1*/: Int/*Int.scala*/ = math.max/*package.scala*/ |} |""".stripMargin ) diff --git a/tests/unit/src/test/scala/tests/FileWatcherSlowSuite.scala b/tests/unit/src/test/scala/tests/FileWatcherSlowSuite.scala index 11ff84c8386..adae97bd15d 100644 --- a/tests/unit/src/test/scala/tests/FileWatcherSlowSuite.scala +++ b/tests/unit/src/test/scala/tests/FileWatcherSlowSuite.scala @@ -63,8 +63,8 @@ object FileWatcherSlowSuite extends BaseSlowSuite("file-watcher") { |/c/src/main/scala/C.scala |package c |object C/*L1*/ { - | println/*Predef.scala:396*/(a.ScalaFileEvent/*A.scala:3*/) - | println/*Predef.scala:396*/(new a.JavaFileEvent/*JavaFileEvent.java:2*/) + | println/*Predef.scala*/(a.ScalaFileEvent/*A.scala:3*/) + | println/*Predef.scala*/(new a.JavaFileEvent/*JavaFileEvent.java:2*/) |} |""".stripMargin ) diff --git a/tests/unit/src/test/scala/tests/QuickBuildSuite.scala b/tests/unit/src/test/scala/tests/QuickBuildSuite.scala index 5f81649eaf4..93ff51a8aa3 100644 --- a/tests/unit/src/test/scala/tests/QuickBuildSuite.scala +++ b/tests/unit/src/test/scala/tests/QuickBuildSuite.scala @@ -52,25 +52,24 @@ object QuickBuildSuite extends BaseSlowSuite("quick-build") { _ <- server.didOpen("a/src/main/scala/a/A.scala") _ = assertNoDiff( server.workspaceDefinitions, - """ - |/a/src/main/scala/a/A.scala - |package a - |import com.geirsson.coursiersmall._ - |import scala.util.Success/*Try.scala:239*/ - |object A/*L3*/ { - | val settings/*L4*/ = new Settings/*Settings.scala:16*/() - |} - |/b/src/main/scala/b/B.scala - |package b - |import a._ - |import scala.util.Success/*Try.scala:239*/ - |import org.scalatest._ - |class B/*L4*/ extends FunSuite/*FunSuite.scala:1559*/ { - | test/*FunSuiteLike.scala:119*/("") { - | println/*Predef.scala:392*/(A/*A.scala:3*/.settings/*A.scala:4*/) - | } - |} - """.stripMargin + """|/a/src/main/scala/a/A.scala + |package a + |import com.geirsson.coursiersmall._ + |import scala.util.Success/*Try.scala*/ + |object A/*L3*/ { + | val settings/*L4*/ = new Settings/*Settings.scala*/() + |} + |/b/src/main/scala/b/B.scala + |package b + |import a._ + |import scala.util.Success/*Try.scala*/ + |import org.scalatest._ + |class B/*L4*/ extends FunSuite/*FunSuite.scala*/ { + | test/*FunSuiteLike.scala*/("") { + | println/*Predef.scala*/(A/*A.scala:3*/.settings/*A.scala:4*/) + | } + |} + |""".stripMargin ) } yield () }