diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90c360998af..9abc2e2b485 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,10 +66,12 @@ jobs: command: bin/test.sh 'slow/testOnly -- tests.gradle.*' name: Gradle MacOS integration os: macOS-latest + java: "17" - type: sbt command: bin/test.sh 'slow/testOnly -- tests.sbt.*' name: Sbt integration os: ubuntu-latest + java: "17" - type: sbt-metals jdk8 command: bin/test.sh sbt-metals/scripted name: Sbt-metals/scripted jdk8 @@ -79,52 +81,68 @@ jobs: command: bin/test.sh 'slow/testOnly -- tests.maven.*' name: Maven integration os: ubuntu-latest + java: "17" - type: gradle command: bin/test.sh 'slow/testOnly -- tests.gradle.*' name: Gradle integration os: ubuntu-latest + java: "17" - type: mill command: bin/test.sh 'slow/testOnly -- tests.mill.*' name: Mill integration os: ubuntu-latest + java: "17" - type: scalacli command: bin/test.sh 'slow/testOnly -- tests.scalacli.*' name: Scala CLI integration os: ubuntu-latest + java: "17" - type: feature command: bin/test.sh 'slow/testOnly -- tests.feature.*' name: LSP integration tests os: ubuntu-latest + java: "17" - type: cross command: sbt +cross/test name: Scala cross tests os: ubuntu-latest + java: "17" - type: mtags-java command: sbt javapc/test name: Scala javapc tests os: ubuntu-latest + java: "17" - type: cross-test-nightly command: sbt cross-test-latest-nightly name: Scala3 latest NIGHTLY cross test os: ubuntu-latest + java: "17" + - type: cross-test-2-11 + command: sbt cross-test-2-11 + name: Scala 2.11 cross tests + os: ubuntu-latest + java: "8" - type: scalafix command: sbt scalafixCheck docs/docusaurusCreateSite name: Scalafix and docs os: ubuntu-latest + java: "17" - type: scalafmt command: ./bin/scalafmt --test name: Formatting os: ubuntu-latest + java: "17" - type: MiMa command: sbt interfaces/mimaReportBinaryIssues name: MiMa os: ubuntu-latest + java: "17" steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: "17" + java-version: ${{ matrix.java }} cache: 'sbt' - name: ${{ matrix.command }} run: ${{ matrix.command }} diff --git a/.scalafmt.conf b/.scalafmt.conf index 842d3e13fb6..8b6a29938db 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -35,4 +35,10 @@ fileOverride { "glob:**/mtags*/**" { trailingCommas = never } + "glob:**/tests/cross/src/**" { + trailingCommas = never + } + "glob:**/mtest/**" { + trailingCommas = never + } } diff --git a/build.sbt b/build.sbt index caa8ff03879..0549d63f5c4 100644 --- a/build.sbt +++ b/build.sbt @@ -152,6 +152,9 @@ commands ++= Seq( s } }, + Command.command("cross-test-2-11") { s => + crossTestDyn(s, V.scala211) + }, Command.single("test-mtags-dyn") { (s, scalaV) => crossTestDyn(s, scalaV) }, diff --git a/mtags/src/main/scala-2/scala/meta/internal/pc/SignatureHelpProvider.scala b/mtags/src/main/scala-2/scala/meta/internal/pc/SignatureHelpProvider.scala index d87771e22a6..1f4e75a4565 100644 --- a/mtags/src/main/scala-2/scala/meta/internal/pc/SignatureHelpProvider.scala +++ b/mtags/src/main/scala-2/scala/meta/internal/pc/SignatureHelpProvider.scala @@ -475,6 +475,9 @@ class SignatureHelpProvider(val compiler: MetalsGlobal) { shortenedNames ) } + if (activeSignature == null) { + activeSignature = 0 + } val mainSignature = infos(activeSignature) val deduplicated = infos .filter { sig => diff --git a/tests/cross/src/main/scala/tests/BaseAutoImportsSuite.scala b/tests/cross/src/main/scala/tests/BaseAutoImportsSuite.scala index 84f6cc59114..a58409e6767 100644 --- a/tests/cross/src/main/scala/tests/BaseAutoImportsSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseAutoImportsSuite.scala @@ -18,14 +18,14 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { name: String, original: String, expected: String, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location): Unit = test(name) { val imports = getAutoImports(original, "A.scala") val obtained = imports.map(_.packageName()).mkString("\n") assertNoDiff( obtained, - getExpected(expected, compat, scalaVersion), + getExpected(expected, compat, scalaVersion) ) } @@ -35,7 +35,7 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { expected: String, selection: Int = 0, filename: String = "A.scala", - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location ): Unit = @@ -46,7 +46,7 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { original: String, expected: String, selection: Int = 0, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location ): Unit = @@ -56,7 +56,7 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { original, expected, selection, - compat, + compat ) def checkEditSelection( @@ -65,7 +65,7 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { original: String, expected: String, selection: Int, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location ): Unit = @@ -80,7 +80,7 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { def getAutoImports( original: String, - filename: String, + filename: String ): List[AutoImportsResult] = { val (code, symbol, offset) = params(original) val result = presentationCompiler @@ -90,9 +90,9 @@ trait BaseAutoImportsSuite extends BaseCodeActionSuite { Paths.get(filename).toUri(), code, offset, - cancelToken, + cancelToken ), - isExtensionMethods, + isExtensionMethods ) .get() result.asScala.toList diff --git a/tests/cross/src/main/scala/tests/BaseCompletionSuite.scala b/tests/cross/src/main/scala/tests/BaseCompletionSuite.scala index e5a57ca640e..ea206c63371 100644 --- a/tests/cross/src/main/scala/tests/BaseCompletionSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseCompletionSuite.scala @@ -36,7 +36,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { private def getItems( original: String, - filename: String = "A.scala", + filename: String = "A.scala" ): Seq[CompletionItem] = { val (code, offset) = params(original, filename) val result = resolvedCompletions( @@ -44,7 +44,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { Paths.get(filename).toUri(), code, offset, - cancelToken, + cancelToken ) ) result.getItems.asScala @@ -62,7 +62,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { def checkItems( name: TestOptions, original: String, - fn: Seq[CompletionItem] => Boolean, + fn: Seq[CompletionItem] => Boolean )(implicit loc: Location): Unit = { test(name) { assert(fn(getItems(original))) } } @@ -91,7 +91,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { assertSingleItem: Boolean = true, filter: String => Boolean = _ => true, command: Option[String] = None, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location): Unit = { val compatTemplate = compat.map { case (key, value) => key -> template.replace("___", value) @@ -104,7 +104,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { assertSingleItem = assertSingleItem, filter = filter, command = command, - compat = compatTemplate, + compat = compatTemplate ) } @@ -131,7 +131,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { command: Option[String] = None, compat: Map[String, String] = Map.empty, itemIndex: Int = 0, - filename: String = "A.scala", + filename: String = "A.scala" )(implicit loc: Location): Unit = { test(name) { val items = @@ -148,7 +148,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { val obtained = TextEdits.applyEdits(code, item) assertNoDiff( obtained, - getExpected(expected, compat, scalaVersion), + getExpected(expected, compat, scalaVersion) ) if (filterText.nonEmpty) { assertNoDiff(item.getFilterText, filterText, "Invalid filter text") @@ -156,7 +156,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { assertNoDiff( Option(item.getCommand).fold("")(_.getCommand), command.getOrElse(""), - "Invalid command", + "Invalid command" ) } } @@ -175,7 +175,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { expected: String, compat: Map[String, String] = Map.empty, topLines: Option[Int] = None, - includeDetail: Boolean = false, + includeDetail: Boolean = false )(implicit loc: Location): Unit = { test(name) { val baseItems = getItems(original) @@ -196,7 +196,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { .mkString("\n") assertNoDiff( obtained, - getExpected(expected, compat, scalaVersion), + getExpected(expected, compat, scalaVersion) ) } } @@ -235,7 +235,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { includeDetail: Boolean = true, filename: String = "A.scala", filter: String => Boolean = _ => true, - enablePackageWrap: Boolean = true, + enablePackageWrap: Boolean = true )(implicit loc: Location): Unit = { test(name) { val out = new StringBuilder() @@ -280,19 +280,19 @@ abstract class BaseCompletionSuite extends BasePCSuite { assertNoDiff( sortLines( stableOrder, - postProcessObtained(trimTrailingSpace(out.toString())), + postProcessObtained(trimTrailingSpace(out.toString())) ), sortLines( stableOrder, - getExpected(expected, compat, scalaVersion), - ), + getExpected(expected, compat, scalaVersion) + ) ) if (filterText.nonEmpty) { filteredItems.foreach { item => assertNoDiff( item.getFilterText, filterText, - s"Invalid filter text for item:\n$item", + s"Invalid filter text for item:\n$item" ) } } @@ -310,7 +310,7 @@ abstract class BaseCompletionSuite extends BasePCSuite { s.replace("equals(obj: Any)", "equals(obj: Object)") .replace( "singletonList[T](o: T)", - "singletonList[T <: Object](o: T)", + "singletonList[T <: Object](o: T)" ) } ) diff --git a/tests/cross/src/main/scala/tests/BaseDocumentHighlightSuite.scala b/tests/cross/src/main/scala/tests/BaseDocumentHighlightSuite.scala index 5cd140dfacb..bbc82345aa2 100644 --- a/tests/cross/src/main/scala/tests/BaseDocumentHighlightSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseDocumentHighlightSuite.scala @@ -14,8 +14,8 @@ class BaseDocumentHighlightSuite extends BasePCSuite with RangeReplace { def check( name: TestOptions, - original: String, - // compat: Map[String, String] = Map.empty, + original: String + // compat: Map[String, String] = Map.empty )(implicit location: Location): Unit = test(name) { @@ -30,7 +30,7 @@ class BaseDocumentHighlightSuite extends BasePCSuite with RangeReplace { URI.create("file:/Highlight.scala"), code, offset, - EmptyCancelToken, + EmptyCancelToken ) ) .get() @@ -41,13 +41,13 @@ class BaseDocumentHighlightSuite extends BasePCSuite with RangeReplace { assertEquals( renderHighlightsAsString(base, highlights), - expected, + expected ) } private def compareHighlights( h1: DocumentHighlight, - h2: DocumentHighlight, + h2: DocumentHighlight ) = { val r1 = h1.getRange().getStart() val r2 = h2.getRange().getStart() diff --git a/tests/cross/src/main/scala/tests/BaseExtractMethodSuite.scala b/tests/cross/src/main/scala/tests/BaseExtractMethodSuite.scala index b82d2b95381..480bc0125f1 100644 --- a/tests/cross/src/main/scala/tests/BaseExtractMethodSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseExtractMethodSuite.scala @@ -17,7 +17,7 @@ class BaseExtractMethodSuite extends BaseCodeActionSuite { name: TestOptions, original: String, expected: String, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit location: Location): Unit = test(name) { val (edits, code) = getAutoImplement(original) @@ -27,7 +27,7 @@ class BaseExtractMethodSuite extends BaseCodeActionSuite { def getAutoImplement( original: String, - filename: String = "file:/A.scala", + filename: String = "file:/A.scala" ): (List[l.TextEdit], String) = { val withoutExtractionPos = original.replace("@@", "") val onlyRangeClose = withoutExtractionPos @@ -37,19 +37,19 @@ class BaseExtractMethodSuite extends BaseCodeActionSuite { URI.create(filename), code, original.indexOf("@@"), - cancelToken, + cancelToken ) val rangeParams = CompilerRangeParams( URI.create(filename), code, withoutExtractionPos.indexOf("<<"), onlyRangeClose.indexOf(">>"), - cancelToken, + cancelToken ) val result = presentationCompiler .extractMethod( rangeParams, - extractionPos, + extractionPos ) .get() (result.asScala.toList, code) diff --git a/tests/cross/src/main/scala/tests/BasePCSuite.scala b/tests/cross/src/main/scala/tests/BasePCSuite.scala index 6a456137638..daa4a47895b 100644 --- a/tests/cross/src/main/scala/tests/BasePCSuite.scala +++ b/tests/cross/src/main/scala/tests/BasePCSuite.scala @@ -98,7 +98,7 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { private def indexScalaLibrary( index: GlobalSymbolIndex, - scalaVersion: String, + scalaVersion: String ): Unit = { val libDependency = Dependency.of( @@ -112,7 +112,7 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { case v if isScala3Version(v) => BuildInfoVersions.scala213 case v if v.startsWith("2.12") => v case _ => BuildInfoVersions.scala212 - }, + } ) val deps = if (isScala3Version(scalaVersion)) { Seq( @@ -120,8 +120,8 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { Dependency.of( "org.scala-lang", "scala3-library_3", - scalaVersion, - ), + scalaVersion + ) ) } else { Seq(libDependency) @@ -158,7 +158,7 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { "Append Scala version", { test => test.withName(test.name + "_" + scalaVersion) - }, + } ), new TestTransform( "Ignore Scala version", @@ -171,7 +171,7 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { if (isIgnoredScalaVersion) test.withTags(test.tags + munit.Ignore) else test - }, + } ), new TestTransform( "Run for Scala version", @@ -184,18 +184,18 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { } .getOrElse(test) - }, - ), + } + ) ) override def params( code: String, - filename: String = "test.scala", + filename: String = "test.scala" ): (String, Int) = super.params(code, filename) override def hoverParams( code: String, - filename: String = "test.scala", + filename: String = "test.scala" ): (String, Int, Int) = super.hoverParams(code, filename) def doc(e: JEither[String, MarkupContent]): String = { @@ -267,6 +267,8 @@ abstract class BasePCSuite extends BaseSuite with PCSuite { object IgnoreScala212 extends IgnoreScalaVersion(_.startsWith("2.12")) + object IgnoreScala211 extends IgnoreScalaVersion(_.startsWith("2.11")) + object IgnoreScala3 extends IgnoreScalaVersion(_.startsWith("3.")) val IgnoreForScala3CompilerPC: IgnoreScalaVersion = diff --git a/tests/cross/src/main/scala/tests/BasePcRenameSuite.scala b/tests/cross/src/main/scala/tests/BasePcRenameSuite.scala index 84743c9be98..23afbcedbcd 100644 --- a/tests/cross/src/main/scala/tests/BasePcRenameSuite.scala +++ b/tests/cross/src/main/scala/tests/BasePcRenameSuite.scala @@ -17,7 +17,7 @@ class BasePcRenameSuite extends BasePCSuite with RangeReplace { methodBody: String, newName: String = "newName", filename: String = "A.scala", - wrap: Boolean = true, + wrap: Boolean = true )(implicit location: Location): Unit = test(name) { val original = @@ -41,9 +41,9 @@ class BasePcRenameSuite extends BasePCSuite with RangeReplace { URI.create(s"file:/$filename"), code, offset, - EmptyCancelToken, + EmptyCancelToken ), - newName, + newName ) .get() .asScala @@ -51,7 +51,7 @@ class BasePcRenameSuite extends BasePCSuite with RangeReplace { assertEquals( TextEdits.applyEdits(base, renames), - expected, + expected ) } @@ -59,7 +59,7 @@ class BasePcRenameSuite extends BasePCSuite with RangeReplace { def prepare( name: TestOptions, input: String, - filename: String = "A.scala", + filename: String = "A.scala" ): Unit = { test(name) { val edit = input.replaceAll("(<<|>>)", "") @@ -73,7 +73,7 @@ class BasePcRenameSuite extends BasePCSuite with RangeReplace { URI.create(s"file:/$filename"), code, offset, - EmptyCancelToken, + EmptyCancelToken ) ) .get() @@ -82,7 +82,7 @@ class BasePcRenameSuite extends BasePCSuite with RangeReplace { if (!range.isPresent()) base else replaceInRange(base, range.get()) assertNoDiff( withRange, - expected, + expected ) } } diff --git a/tests/cross/src/main/scala/tests/BaseSemanticTokensSuite.scala b/tests/cross/src/main/scala/tests/BaseSemanticTokensSuite.scala index f298b1ba84f..213af980e0c 100644 --- a/tests/cross/src/main/scala/tests/BaseSemanticTokensSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseSemanticTokensSuite.scala @@ -15,7 +15,7 @@ class BaseSemanticTokensSuite extends BasePCSuite { def check( name: TestOptions, expected: String, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit location: Location): Unit = test(name) { val base = @@ -30,11 +30,11 @@ class BaseSemanticTokensSuite extends BasePCSuite { val obtained = TestSemanticTokens.pcSemanticString( base, - nodes.asScala.toList, + nodes.asScala.toList ) assertEquals( obtained, - getExpected(expected, compat, scalaVersion), + getExpected(expected, compat, scalaVersion) ) } diff --git a/tests/cross/src/main/scala/tests/BaseSignatureHelpSuite.scala b/tests/cross/src/main/scala/tests/BaseSignatureHelpSuite.scala index aef31c9aa69..058af0ea91f 100644 --- a/tests/cross/src/main/scala/tests/BaseSignatureHelpSuite.scala +++ b/tests/cross/src/main/scala/tests/BaseSignatureHelpSuite.scala @@ -14,7 +14,7 @@ abstract class BaseSignatureHelpSuite extends BasePCSuite { name: TestOptions, code: String, expected: String, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location): Unit = { check(name, code, expected, includeDocs = true, compat = compat) } @@ -24,7 +24,7 @@ abstract class BaseSignatureHelpSuite extends BasePCSuite { expected: String, includeDocs: Boolean = false, compat: Map[String, String] = Map.empty, - stableOrder: Boolean = true, + stableOrder: Boolean = true )(implicit loc: Location): Unit = { test(name) { val pkg = scala.meta.Term.Name(name.name).syntax @@ -98,8 +98,8 @@ abstract class BaseSignatureHelpSuite extends BasePCSuite { sortLines(stableOrder, out.toString()), sortLines( stableOrder, - getExpected(expected, compat, scalaVersion), - ), + getExpected(expected, compat, scalaVersion) + ) ) } } diff --git a/tests/cross/src/main/scala/tests/pc/BaseHoverSuite.scala b/tests/cross/src/main/scala/tests/pc/BaseHoverSuite.scala index 916d308d35d..602f4f83f76 100644 --- a/tests/cross/src/main/scala/tests/pc/BaseHoverSuite.scala +++ b/tests/cross/src/main/scala/tests/pc/BaseHoverSuite.scala @@ -24,7 +24,7 @@ abstract class BaseHoverSuite expected: String, includeRange: Boolean = false, automaticPackage: Boolean = true, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location): Unit = { test(testOpt) { val filename = "Hover.scala" @@ -50,7 +50,7 @@ abstract class BaseHoverSuite val obtained: String = renderAsString(code, hover, includeRange) assertNoDiff( obtained, - getExpected(expected, compat, scalaVersion), + getExpected(expected, compat, scalaVersion) ) for { h <- hover @@ -65,7 +65,7 @@ abstract class BaseHoverSuite .replace("@@", "") .replace("%<%", "") .replace("%>%", ""), - "Invalid range", + "Invalid range" ) } } @@ -75,7 +75,7 @@ abstract class BaseHoverSuite "2.13" -> { s => s.replace( "def map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That", - "def map[B](f: Int => B): List[B]", + "def map[B](f: Int => B): List[B]" ) } ) diff --git a/tests/cross/src/main/scala/tests/pc/BasePcDefinitionSuite.scala b/tests/cross/src/main/scala/tests/pc/BasePcDefinitionSuite.scala index 07edb834d94..c1b33ac46a9 100644 --- a/tests/cross/src/main/scala/tests/pc/BasePcDefinitionSuite.scala +++ b/tests/cross/src/main/scala/tests/pc/BasePcDefinitionSuite.scala @@ -21,7 +21,7 @@ abstract class BasePcDefinitionSuite extends BasePCSuite { def check( options: TestOptions, original: String, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location): Unit = { test(options) { val filename = "A.scala" @@ -43,17 +43,17 @@ abstract class BasePcDefinitionSuite extends BasePCSuite { new TextEdit( new l.Range( location.getRange().getStart(), - location.getRange().getStart(), + location.getRange().getStart() ), - "<<", + "<<" ), new TextEdit( new l.Range( location.getRange().getEnd(), - location.getRange().getEnd(), + location.getRange().getEnd() ), - ">>", - ), + ">>" + ) ) } else { val filename = location.getUri() @@ -65,7 +65,7 @@ abstract class BasePcDefinitionSuite extends BasePCSuite { val expected = getExpected(original, compat, scalaVersion).removePos assertNoDiff( obtained, - expected, + expected ) } } diff --git a/tests/cross/src/main/scala/tests/pc/BaseSelectionRangeSuite.scala b/tests/cross/src/main/scala/tests/pc/BaseSelectionRangeSuite.scala index 71f977519d5..9851bfa6337 100644 --- a/tests/cross/src/main/scala/tests/pc/BaseSelectionRangeSuite.scala +++ b/tests/cross/src/main/scala/tests/pc/BaseSelectionRangeSuite.scala @@ -21,7 +21,7 @@ abstract class BaseSelectionRangeSuite extends BasePCSuite { name: TestOptions, original: String, expectedRanges: List[String], - compat: Map[String, List[String]] = Map.empty, + compat: Map[String, List[String]] = Map.empty ): Unit = { test(name) { val (code, offset) = params(original, "SelectionRange.scala") @@ -30,7 +30,7 @@ abstract class BaseSelectionRangeSuite extends BasePCSuite { Paths.get("SelectionRange.scala").toUri(), code, offset, - EmptyCancelToken, + EmptyCancelToken ) ).asJava @@ -52,7 +52,7 @@ abstract class BaseSelectionRangeSuite extends BasePCSuite { assertSelectionRanges( selectionRanges.headOption, compatOrDefault(expectedRanges, compat, scalaVersion), - code, + code ) } } @@ -60,7 +60,7 @@ abstract class BaseSelectionRangeSuite extends BasePCSuite { private def assertSelectionRanges( range: Option[l.SelectionRange], expected: List[String], - original: String, + original: String ): Unit = { assert(range.nonEmpty) expected.headOption.foreach { expectedRange => @@ -72,7 +72,7 @@ abstract class BaseSelectionRangeSuite extends BasePCSuite { private def applyRanges( text: String, - selectionRange: l.SelectionRange, + selectionRange: l.SelectionRange ): String = { val input = Input.String(text) diff --git a/tests/cross/src/test/scala/tests/highlight/DocumentHighlightSuite.scala b/tests/cross/src/test/scala/tests/highlight/DocumentHighlightSuite.scala index bdae6d5ec0d..15f1a14f56d 100644 --- a/tests/cross/src/test/scala/tests/highlight/DocumentHighlightSuite.scala +++ b/tests/cross/src/test/scala/tests/highlight/DocumentHighlightSuite.scala @@ -9,7 +9,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { """ |object Main { | Option(1).<> - |}""".stripMargin, + |}""".stripMargin ) check( @@ -19,7 +19,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val <> = 123 | <>.toInt | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( "multiple2", @@ -28,7 +28,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val <> = 123 | <>.toInt | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -38,7 +38,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val <> = 123 | <>.toInt | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -48,7 +48,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val abc = 123 | abc.<> | 134l.toInt - |}""".stripMargin, + |}""".stripMargin ) check( @@ -61,7 +61,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <> = 456 | ) | - |}""".stripMargin, + |}""".stripMargin ) check( @@ -76,11 +76,11 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val y = x.<> | | - |}""".stripMargin, + |}""".stripMargin ) check( - "named-args2", + "named-args2".tag(IgnoreScala211), """ |object Main { | def foo = check("abc")( @@ -93,11 +93,11 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <>: Int, | otherDefault: String = "default" | ): Unit = () - |}""".stripMargin, + |}""".stripMargin ) check( - "named-args2", + "named-args2".tag(IgnoreScala211), """ |object Main { | def foo = check("abc")( @@ -110,7 +110,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <>: Int, | otherDefault: String = "default" | ): Unit = () - |}""".stripMargin, + |}""".stripMargin ) check( @@ -129,7 +129,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <>: Int, | otherDefault: String = "default" | )(loc: Boolean): Unit = () - |}""".stripMargin, + |}""".stripMargin ) check( @@ -139,7 +139,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val <<@@a>> = 123 | val f = (a: Int) => a + 1 | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -149,7 +149,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val <> = 123 | val f = (a: Int) => a + 1 | println(<<@@a>>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -160,7 +160,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = User(<> = "Susan") | println(user.<>) | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -171,7 +171,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = User(<> = "Susan") | println(user.<>) | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -182,7 +182,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = User(<> = "Susan") | println(user.<>) | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -193,7 +193,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = User(<> = "Susan") | println(user.<>) | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -205,7 +205,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = <>(name = "Susan") | println(user.name) | user.copy(name = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -217,7 +217,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = <>(name = "Susan") | println(user.name) | user.copy(name = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -229,7 +229,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val user = <>(name = "Susan") | println(user.name) | user.copy(name = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -241,7 +241,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | println(user.<>) | user.<> = "" | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -253,7 +253,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | println(user.<>) | user.<> = "" | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -265,7 +265,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | println(user.<>) | user.<> = "" | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -277,7 +277,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | println(user.<>) | user.<> = "" | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -289,7 +289,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | println(user.<>) | user.<> = "" | user.copy(<> = "John") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -300,7 +300,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <> = 344 | <> +=1 | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -311,7 +311,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <> = 344 | <> +=1 | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -322,7 +322,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <> = 344 | <> +=1 | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -333,7 +333,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <> = 344 | <> +=1 | println(<>) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -343,7 +343,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def hello() = "" | def <>(a : Int) = "" | def hello(a : Int, b : String) = "" - |}""".stripMargin, + |}""".stripMargin ) check( @@ -360,7 +360,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -377,7 +377,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -394,7 +394,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -411,7 +411,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( "local-assign2", @@ -427,7 +427,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( "local-assign3", @@ -443,7 +443,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -460,7 +460,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -477,7 +477,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -494,7 +494,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def m2: Int = abc + 2 | } | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -507,7 +507,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | } | val t = new T1 | t.<> = 123 - |}""".stripMargin, + |}""".stripMargin ) check( @@ -521,7 +521,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val t = new T1 | t.<> = 123 | - |}""".stripMargin, + |}""".stripMargin ) check( @@ -534,7 +534,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | } | val t = new T1 | t.<> = 123 - |}""".stripMargin, + |}""".stripMargin ) check( @@ -545,7 +545,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def bar(<>: String) = ??? | foo(name = "123") | bar(<> = "123") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -556,7 +556,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def bar(<>: String) = ??? | foo(name = "123") | bar(<> = "123") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -567,7 +567,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def bar(name: String) = ??? | foo(<> = "123") | bar(name = "123") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -578,7 +578,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def bar(name: String) = ??? | foo(<> = "123") | bar(name = "123") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -587,7 +587,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.<> |object Test { | <>(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -596,7 +596,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.<> |object Test { | <>(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -605,7 +605,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.<>.Try |object Test { | scala.<>.Try(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -614,7 +614,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.<>.Try |object Test { | scala.<>.Try(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -623,7 +623,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.{ <> => <>} |object Test { | <>(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -632,7 +632,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.{ <> => <>} |object Test { | <>(1) - |}""".stripMargin, + |}""".stripMargin ) // @note, we could try and not highlight normal Try, @@ -643,7 +643,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.{ <> => <>} |object Test { | scala.util.<>(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -652,7 +652,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.{ <> => <>} |object Test { | scala.util.<>(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -661,7 +661,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { |import scala.util.{ <> => <>} |object Test { | scala.util.<>(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -674,7 +674,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | case Success(<>) => | <> | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -687,7 +687,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | case Success(<>) => | <> | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -698,7 +698,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | object <>{ def nnn = ""} | <>.nnn | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -709,7 +709,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | object <>{ def nnn = ""} | <>.nnn | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -720,7 +720,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | object <>{ def nnn = ""} | <>.nnn | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -733,13 +733,13 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <>.nnn | } | } - |}""".stripMargin, + |}""".stripMargin ) check( // Scala 2.12.x has a bug where the namePos points at `object` // working around it would involve a lot of additional logic - "package-object".tag(IgnoreScala212), + "package-object".tag(IgnoreScalaVersion.forLessThan("2.13.0")), """|package example | |package object <> { @@ -747,7 +747,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | class PackageObjectNestedClass | |} - |""".stripMargin, + |""".stripMargin ) check( @@ -757,7 +757,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | case class User(<>: String) | val a = User(<> = "abc") | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -766,7 +766,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val <<`hi-!`>> = 5 | | <<`hi@@-!`>> + 3 - |}""".stripMargin, + |}""".stripMargin ) check( @@ -777,21 +777,21 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <> + 1 | } | val d = abc + 1 - |}""".stripMargin, + |}""".stripMargin ) check( "select-parentheses", """|object Main { | val a = (1 + 2 + 3).<> - |}""".stripMargin, + |}""".stripMargin ) check( "select-parentheses2".tag(IgnoreScala2), """|object Main { | val a = (1 + 2 + 3) <<:@@:>> Nil - |}""".stripMargin, + |}""".stripMargin ) check( @@ -804,7 +804,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | a, | <>, | ) - |}""".stripMargin, + |}""".stripMargin ) check( "trailling-comma2".tag(IgnoreScala2), @@ -816,7 +816,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | a, | <<`ab@@`>>, | ) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -833,7 +833,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | val x = foo + <> + baz | x | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -844,7 +844,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | a <- List(1) | } yield a + 1 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -856,7 +856,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | if true | } yield a + 1 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -867,7 +867,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | a <- List(1) | } {} |} - |""".stripMargin, + |""".stripMargin ) check( @@ -879,7 +879,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | if true | } {} |} - |""".stripMargin, + |""".stripMargin ) check( @@ -891,7 +891,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | if true | } yield a + 1 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -904,7 +904,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | if true | } yield a + 1 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -917,7 +917,7 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | b <- List(2) | } yield a + 1 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -928,6 +928,6 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite { | <<`ty@@pe`>> = "abc" | ) |} - |""".stripMargin, + |""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/highlight/Scala3DocumentHighlightSuite.scala b/tests/cross/src/test/scala/tests/highlight/Scala3DocumentHighlightSuite.scala index 045f8c69fe1..5d2783efdd4 100644 --- a/tests/cross/src/test/scala/tests/highlight/Scala3DocumentHighlightSuite.scala +++ b/tests/cross/src/test/scala/tests/highlight/Scala3DocumentHighlightSuite.scala @@ -12,7 +12,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|enum FooEnum: | case <>, Baz |val bar = FooEnum.<> - |""".stripMargin, + |""".stripMargin ) check( @@ -20,7 +20,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|enum FooEnum: | case <>, Baz |val bar = FooEnum.<> - |""".stripMargin, + |""".stripMargin ) check( @@ -31,7 +31,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { |transparent inline def <>(i: Int): Foo = new Bar |val iii = 123 |val bar = <>(iii) - |""".stripMargin, + |""".stripMargin ) check( @@ -42,7 +42,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { |transparent inline def <>(i: Int): Foo = new Bar |val iii = 123 |val bar = <>(iii) - |""".stripMargin, + |""".stripMargin ) check( @@ -53,7 +53,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { |transparent inline def foo(i: Int): Foo = new Bar |val <> = 123 |val bar = foo(<>) - |""".stripMargin, + |""".stripMargin ) check( @@ -64,7 +64,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { |transparent inline def foo(i: Int): Foo = new Bar |val <> = 123 |val bar = foo(<>) - |""".stripMargin, + |""".stripMargin ) check( @@ -75,7 +75,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | else | val y = <>(x, n / 2) | if n % 2 == 0 then y * y else y * y * x - |""".stripMargin, + |""".stripMargin ) check( @@ -86,7 +86,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | else | val y = <>(x, n / 2) | if n % 2 == 0 then y * y else y * y * x - |""".stripMargin, + |""".stripMargin ) check( @@ -95,7 +95,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def double = <> + <> | def double2 = <> + <> |end extension - |""".stripMargin, + |""".stripMargin ) check( @@ -104,7 +104,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def double = <> + <> | def double2 = <> + <> |end extension - |""".stripMargin, + |""".stripMargin ) check( @@ -113,7 +113,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def double = <> ++ <> | def double2 = <> ++ <> |end extension - |""".stripMargin, + |""".stripMargin ) check( @@ -122,7 +122,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def double = <> ++ <> | def double2 = <> ++ <> |end extension - |""".stripMargin, + |""".stripMargin ) check( @@ -133,7 +133,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | | val x = 1.<>() | val y = (1: Int).<>() - |""".stripMargin, + |""".stripMargin ) check( @@ -153,43 +153,43 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | map.get(key) match | case None => Left(s"Missing ${key} in }") | case Some(value) => Right(value) - |""".stripMargin, + |""".stripMargin ) check( "given-synthetic1", """|given (usi@@ng i: Int): Double = 4.0 - |val a = given_Double""".stripMargin, + |val a = given_Double""".stripMargin ) check( "given-synthetic2", """|given (using i: Int): Double = 4.0 - |val a = <>""".stripMargin, + |val a = <>""".stripMargin ) check( "given-synthetic3", """|given Int = 10 - |val a = <>""".stripMargin, + |val a = <>""".stripMargin ) check( "given-synthetic4", """|given <> = 10 - |val a = given_Int""".stripMargin, + |val a = given_Int""".stripMargin ) check( "given-not-synthetic1", """|given <<`giv@@en_D`>>: Double = 4.0 - |val a = <<`given_D`>>""".stripMargin, + |val a = <<`given_D`>>""".stripMargin ) check( "given-not-synthetic2", """|given <<`given_D`>>:Double = 4.0 - |val a = <<`giv@@en_D`>>""".stripMargin, + |val a = <<`giv@@en_D`>>""".stripMargin ) check( @@ -197,14 +197,14 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|extension [<>](xs: List[<>]) | def double(ys: List[<>]) = xs ++ ys | def double2(ys: List[<>]) = xs ++ ys - |end extension""".stripMargin, + |end extension""".stripMargin ) check( "extension-with-type-param2", """|extension [EF, <>](xs: Either[<>, EF]) | def id() = xs - |end extension""".stripMargin, + |end extension""".stripMargin ) check( @@ -212,7 +212,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|extension [<>](xs: List[<>]) | def double(ys: List[<>]) = xs ++ ys | def double2(ys: List[<>]) = xs ++ ys - |end extension""".stripMargin, + |end extension""".stripMargin ) check( @@ -220,7 +220,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|val i: <> = 3 |extension (xs: List[<>]) | def id() = xs - |end extension""".stripMargin, + |end extension""".stripMargin ) check( @@ -228,7 +228,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|extension [<>](xs: List[<>]) | def double(ys: List[<>]) = xs ++ ys | def double2(ys: List[<>]) = xs ++ ys - |end extension""".stripMargin, + |end extension""".stripMargin ) check( @@ -236,7 +236,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|extension [EF](xs: List[EF]) | def double(<>: List[EF]) = xs ++ <> | def double2(ys: List[EF]) = xs ++ ys - |end extension""".stripMargin, + |end extension""".stripMargin ) check( @@ -244,7 +244,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|extension [EF](<>: List[EF]) | def double(ys: List[EF]) = <> ++ ys | def double2(ys: List[EF]) = <> ++ ys - |end extension""".stripMargin, + |end extension""".stripMargin ) check( @@ -254,7 +254,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | case MyNone | |val alpha = MyOption.<>(1) - |""".stripMargin, + |""".stripMargin ) check( @@ -264,7 +264,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | case MyNone | |val alpha = MyOption.<>(1) - |""".stripMargin, + |""".stripMargin ) check( @@ -272,7 +272,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|enum MyOption[+<>]: | case MySome(value: <>) | case MyNone - |""".stripMargin, + |""".stripMargin ) check( @@ -280,7 +280,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|enum MyOption[+<>]: | case MySome(value: <>) | case MyNone - |""".stripMargin, + |""".stripMargin ) check( @@ -288,7 +288,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|enum MyOption[<>](v: <>): | def get: <> = ??? | case MySome[AA](value: AA) extends MyOption[Int](1) - |""".stripMargin, + |""".stripMargin ) check( @@ -297,7 +297,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | def get: <> = ??? | case MySome(value: <>) | case MyNone - |""".stripMargin, + |""".stripMargin ) check( @@ -305,7 +305,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { """|enum MyOption[AA]: | def get: AA = ??? | case MySome[<>](value: <>) extends MyOption[Int] - |""".stripMargin, + |""".stripMargin ) check( @@ -316,7 +316,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | |val a = MyIntOut(1) |val m = a.<> - |""".stripMargin, + |""".stripMargin ) check( @@ -326,7 +326,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | extension (i: MyIntOut) def <>(u: Int) = i.value % 2 == 1 | |val a = MyIntOut(1).<>(3) - |""".stripMargin, + |""".stripMargin ) check( @@ -336,7 +336,7 @@ class Scala3DocumentHighlightSuite extends BaseDocumentHighlightSuite { | extension (i: MyIntOut) def <<++>>(u: Int) = i.value + u | |val a = MyIntOut(1) <<+@@+>> 3 - |""".stripMargin, + |""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/highlight/SyntheticsDocumentHighlightSuite.scala b/tests/cross/src/test/scala/tests/highlight/SyntheticsDocumentHighlightSuite.scala index 6d3d0aa8302..58b3d58a702 100644 --- a/tests/cross/src/test/scala/tests/highlight/SyntheticsDocumentHighlightSuite.scala +++ b/tests/cross/src/test/scala/tests/highlight/SyntheticsDocumentHighlightSuite.scala @@ -15,7 +15,7 @@ class SyntheticsDocumentHighlightSuite extends BaseDocumentHighlightSuite { |} yield { | <>.toString.toList.map(_.toChar) | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -29,7 +29,7 @@ class SyntheticsDocumentHighlightSuite extends BaseDocumentHighlightSuite { |} yield { | <>.toString.toList.map(_.toChar) | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -43,7 +43,7 @@ class SyntheticsDocumentHighlightSuite extends BaseDocumentHighlightSuite { |} yield { | <>.toString.toList.map(_.toChar) | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -57,7 +57,7 @@ class SyntheticsDocumentHighlightSuite extends BaseDocumentHighlightSuite { |} yield { | <>.toString.toList.map(_.toChar) | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -71,7 +71,7 @@ class SyntheticsDocumentHighlightSuite extends BaseDocumentHighlightSuite { |} yield { | <>.toString.toList.map(_.toChar) | } - |}""".stripMargin, + |}""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/highlight/TypeDocumentHighlightSuite.scala b/tests/cross/src/test/scala/tests/highlight/TypeDocumentHighlightSuite.scala index b300f5eb9ad..ec90816649c 100644 --- a/tests/cross/src/test/scala/tests/highlight/TypeDocumentHighlightSuite.scala +++ b/tests/cross/src/test/scala/tests/highlight/TypeDocumentHighlightSuite.scala @@ -10,7 +10,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | type <> = Int | val set = Set.empty[<>] - |}""".stripMargin, + |}""".stripMargin ) check( @@ -19,7 +19,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | type <> = Int | val set = Set.empty[<>] - |}""".stripMargin, + |}""".stripMargin ) check( "type3", @@ -27,7 +27,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | type NotInt = <> | val set = Set.empty[<>] - |}""".stripMargin, + |}""".stripMargin ) check( @@ -36,7 +36,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | type NotInt = <> | val set = Set.empty[<>] - |}""".stripMargin, + |}""".stripMargin ) check( @@ -45,7 +45,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | var bspSession: Option[<>] = | Option.empty[<>] - |}""".stripMargin, + |}""".stripMargin ) check( "type-in-def2", @@ -53,7 +53,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | var bspSession: Option[<>] = | Option.empty[<>] - |}""".stripMargin, + |}""".stripMargin ) check( @@ -62,7 +62,7 @@ class TypeDocumentHighlightSuite extends BaseDocumentHighlightSuite { |object Test { | var bspSession: <>[String] = | <> = 123 |<<@@a>> + 1 - |""".stripMargin, + |""".stripMargin ) check( @@ -27,7 +37,7 @@ class PcRenameSuite extends BasePcRenameSuite { | } |} |""".stripMargin, - wrap = false, + wrap = false ) check( @@ -38,7 +48,7 @@ class PcRenameSuite extends BasePcRenameSuite { |trait T3[I, J] extends T2[I] { override def <>(p: I): String = super.<>(p) } |trait T4[I, J] extends T3[J, I] { override def <>(p: J): String = super.<>(p) } |trait T5[U] extends T4[U, U] { override def <>(p: U): String = super.<>(p) } - |""".stripMargin, + |""".stripMargin ) check( @@ -47,7 +57,7 @@ class PcRenameSuite extends BasePcRenameSuite { |trait PP extends P |trait A { def <>(a: String): P = ??? } |trait B extends A { override def <>(a: String): PP = ??? } - |""".stripMargin, + |""".stripMargin ) check( @@ -60,7 +70,7 @@ class PcRenameSuite extends BasePcRenameSuite { | val a = new Alphabet with <> |} |""".stripMargin, - newName = "Animal", + newName = "Animal" ) check( @@ -72,7 +82,7 @@ class PcRenameSuite extends BasePcRenameSuite { |class GoodMorning extends Hello { | def <>(abc : String) = true |} - |""".stripMargin, + |""".stripMargin ) check( @@ -88,7 +98,7 @@ class PcRenameSuite extends BasePcRenameSuite { |abstract class C extends B[String] { | def <>(abc : String) : Boolean = false |} - |""".stripMargin, + |""".stripMargin ) check( @@ -104,7 +114,7 @@ class PcRenameSuite extends BasePcRenameSuite { |abstract class C extends B with A { | override def <>(abc : String) : Boolean = false |} - |""".stripMargin, + |""".stripMargin ) check( @@ -116,7 +126,7 @@ class PcRenameSuite extends BasePcRenameSuite { | val user = new User() | "" <<::>> user |} - |""".stripMargin, + |""".stripMargin ) check( @@ -129,7 +139,7 @@ class PcRenameSuite extends BasePcRenameSuite { | "" <<::>> user |} |""".stripMargin, - newName = "+++:", + newName = "+++:" ) check( @@ -138,7 +148,7 @@ class PcRenameSuite extends BasePcRenameSuite { |class Dog extends <> |class Cat extends <> |""".stripMargin, - newName = "Tree", + newName = "Tree" ) check( @@ -146,14 +156,14 @@ class PcRenameSuite extends BasePcRenameSuite { """|class <>{} |object <> {} """.stripMargin, - newName = "Tree", + newName = "Tree" ) check( "companion2", """|class <>{} |object <> """.stripMargin, - newName = "Tree", + newName = "Tree" ) check( @@ -165,7 +175,7 @@ class PcRenameSuite extends BasePcRenameSuite { | case object Dog extends <> | case object Cat extends <> |} - |""".stripMargin, + |""".stripMargin ) check( @@ -181,7 +191,7 @@ class PcRenameSuite extends BasePcRenameSuite { |val a = new Alphabet { | override def <>(adf: String): Int = 321 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -189,7 +199,7 @@ class PcRenameSuite extends BasePcRenameSuite { """|implicit val <>: Int = 1 |def m[A](implicit a: A): A = a |m[Int] - |""".stripMargin, + |""".stripMargin ) check( @@ -201,7 +211,7 @@ class PcRenameSuite extends BasePcRenameSuite { | val toRename = A.<> |} |""".stripMargin, - newName = "`other-rename`", + newName = "`other-rename`" ) check( @@ -213,7 +223,7 @@ class PcRenameSuite extends BasePcRenameSuite { | val toRename = A.<<`to-R@@ename`>> |} |""".stripMargin, - newName = "`other-rename`", + newName = "`other-rename`" ) check( @@ -222,7 +232,7 @@ class PcRenameSuite extends BasePcRenameSuite { |"" match { | case `<>` => |} - |""".stripMargin, + |""".stripMargin ) check( @@ -232,7 +242,7 @@ class PcRenameSuite extends BasePcRenameSuite { | case <<`greeting`>> => |} |""".stripMargin, - newName = "`greeting-!`", + newName = "`greeting-!`" ) check( @@ -241,7 +251,7 @@ class PcRenameSuite extends BasePcRenameSuite { |"" match { | case `<>` => |} - |""".stripMargin, + |""".stripMargin ) check( @@ -251,7 +261,7 @@ class PcRenameSuite extends BasePcRenameSuite { | case `gre@@eting` => |} |""".stripMargin, - newName = "`greeting`", + newName = "`greeting`" ) check( @@ -262,7 +272,7 @@ class PcRenameSuite extends BasePcRenameSuite { | .copy(<> = "43") | .<> |val name2 = Name(<> = "44") - |""".stripMargin, + |""".stripMargin ) check( "params2", @@ -272,14 +282,14 @@ class PcRenameSuite extends BasePcRenameSuite { | .copy(<> = "43") | .<> |val name2 = Name(<> = "44") - |""".stripMargin, + |""".stripMargin ) check( "constructor", """|case class Name(<>: String) |val name2 = new Name(<> = "44") - |""".stripMargin, + |""".stripMargin ) check( @@ -289,7 +299,7 @@ class PcRenameSuite extends BasePcRenameSuite { |val a = classOf[<>] |val b = new CBD[<>] |""".stripMargin, - newName = "Animal", + newName = "Animal" ) check( @@ -299,7 +309,7 @@ class PcRenameSuite extends BasePcRenameSuite { |val a = classOf[<>] |val b = new CBD[<>] |""".stripMargin, - newName = "Animal", + newName = "Animal" ) check( @@ -313,7 +323,7 @@ class PcRenameSuite extends BasePcRenameSuite { | val x = bar |} |""".stripMargin, - newName = "foo2", + newName = "foo2" ) check( @@ -325,7 +335,7 @@ class PcRenameSuite extends BasePcRenameSuite { |val symbol2: <> = Method("method") |val symbol3: <> = Variable("value") |""".stripMargin, - newName = "NewSymbol", + newName = "NewSymbol" ) check( @@ -337,7 +347,7 @@ class PcRenameSuite extends BasePcRenameSuite { |val symbol2: <> = Method("method") |val symbol3: <> = Variable("value") |""".stripMargin, - newName = "NewSymbol", + newName = "NewSymbol" ) check( @@ -348,7 +358,7 @@ class PcRenameSuite extends BasePcRenameSuite { | <> = true | <> == true | } - |""".stripMargin, + |""".stripMargin ) check( @@ -357,7 +367,7 @@ class PcRenameSuite extends BasePcRenameSuite { |trait T1[Z] extends S1[Z] { override def <>(p: Z): String = super.<>(p) } |""".stripMargin, filename = "A.worksheet.sc", - wrap = false, + wrap = false ) check( @@ -368,7 +378,7 @@ class PcRenameSuite extends BasePcRenameSuite { |""".stripMargin, newName = "Tree", filename = "A.worksheet.sc", - wrap = false, + wrap = false ) check( @@ -381,7 +391,7 @@ class PcRenameSuite extends BasePcRenameSuite { | <>.map(_ + 1) | } |} - |""".stripMargin, + |""".stripMargin ) check( @@ -391,7 +401,7 @@ class PcRenameSuite extends BasePcRenameSuite { | def double2 = <> + <> |end extension |""".stripMargin, - newName = "greeting", + newName = "greeting" ) check( @@ -401,7 +411,7 @@ class PcRenameSuite extends BasePcRenameSuite { | def double2 = <> + <> |end extension |""".stripMargin, - newName = "greeting", + newName = "greeting" ) check( @@ -411,7 +421,7 @@ class PcRenameSuite extends BasePcRenameSuite { | def double2 = <> ++ <> |end extension |""".stripMargin, - newName = "ABC", + newName = "ABC" ) check( @@ -421,7 +431,7 @@ class PcRenameSuite extends BasePcRenameSuite { | def double2 = <> ++ <> |end extension |""".stripMargin, - newName = "ABC", + newName = "ABC" ) check( @@ -433,7 +443,7 @@ class PcRenameSuite extends BasePcRenameSuite { | } |} |""".stripMargin, - newName = "testing", + newName = "testing" ) check( @@ -449,7 +459,7 @@ class PcRenameSuite extends BasePcRenameSuite { | ) |} |""".stripMargin, - newName = "`other-rename`", + newName = "`other-rename`" ) check( @@ -464,7 +474,7 @@ class PcRenameSuite extends BasePcRenameSuite { |} yield { | val x = foo + <> + baz | x - |}""".stripMargin, + |}""".stripMargin ) check( @@ -473,7 +483,7 @@ class PcRenameSuite extends BasePcRenameSuite { | <> <- List("a", "b", "c") | _ = println("print!") |} yield <> - |""".stripMargin, + |""".stripMargin ) check( @@ -486,7 +496,7 @@ class PcRenameSuite extends BasePcRenameSuite { | for { | b <- Bar(List(1,2,3)) | } yield b - |""".stripMargin, + |""".stripMargin ) check( @@ -494,7 +504,7 @@ class PcRenameSuite extends BasePcRenameSuite { """|def <>(a: Int) = | ??? |end <> - |""".stripMargin, + |""".stripMargin ) check( @@ -502,7 +512,7 @@ class PcRenameSuite extends BasePcRenameSuite { """|def <>(a: Int) = | ??? |end /* a comment */ <> /* a comment */ - |""".stripMargin, + |""".stripMargin ) check( @@ -510,6 +520,6 @@ class PcRenameSuite extends BasePcRenameSuite { """|def <> = | def bar = | ??? - | end bar""".stripMargin, + | end bar""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/pc/PcSemanticdbSuite.scala b/tests/cross/src/test/scala/tests/pc/PcSemanticdbSuite.scala index d3fd919dab8..7fbc85e08ab 100644 --- a/tests/cross/src/test/scala/tests/pc/PcSemanticdbSuite.scala +++ b/tests/cross/src/test/scala/tests/pc/PcSemanticdbSuite.scala @@ -28,7 +28,7 @@ class PcSemanticdbSuite extends BasePCSuite { | val a/*a.O.a.*/ = 123 | val b/*a.O.b.*/ = a/*a.O.a.*/ +/*scala.Int#`+`(+4).*/ 1 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -57,7 +57,7 @@ class PcSemanticdbSuite extends BasePCSuite { | val b/*_empty_.O.b.*/ = a/*_empty_.O.a.*/ +/*scala.Int#`+`(+4).*/ 1 |} |""".stripMargin - ), + ) ) def check( @@ -65,7 +65,7 @@ class PcSemanticdbSuite extends BasePCSuite { original: String, expected: String, compat: Map[String, String] = Map.empty, - filename: String = "A.scala", + filename: String = "A.scala" )(implicit loc: Location): Unit = { test(name) { val uri = new URI(s"file:///$filename") @@ -76,7 +76,7 @@ class PcSemanticdbSuite extends BasePCSuite { val obtained = Semanticdbs.printTextDocument(withCode) assertNoDiff( obtained, - getExpected(expected, compat, scalaVersion), + getExpected(expected, compat, scalaVersion) ) } } diff --git a/tests/cross/src/test/scala/tests/pc/PrettyPrintSuite.scala b/tests/cross/src/test/scala/tests/pc/PrettyPrintSuite.scala index 67c31117d81..02b3ebaf1dc 100644 --- a/tests/cross/src/test/scala/tests/pc/PrettyPrintSuite.scala +++ b/tests/cross/src/test/scala/tests/pc/PrettyPrintSuite.scala @@ -12,7 +12,7 @@ class PrettyPrintSuite extends BaseCompletionSuite { name: String, original: String, expected: String, - compat: Map[String, String] = Map.empty, + compat: Map[String, String] = Map.empty )(implicit loc: Location): Unit = { val signature = original.replace("@@", "") val completion = original.replaceFirst("@@.*", "@@") @@ -32,7 +32,7 @@ class PrettyPrintSuite extends BaseCompletionSuite { """.stripMargin, completion, expected + suffix, - compat = compatWithSuffix, + compat = compatWithSuffix ) } @@ -41,7 +41,7 @@ class PrettyPrintSuite extends BaseCompletionSuite { "def foo@@(): this.type", // NOTE(olafur): this expected output is undesirable, we widen the type too aggressively. // It would be nice to fix this if possible. - "def foo(): Main", + "def foo(): Main" ) checkSignature( @@ -52,7 +52,7 @@ class PrettyPrintSuite extends BaseCompletionSuite { "def foo(x: Int): Any", compat = Map( "2.13" -> "def foo(x: Int): x.type" - ), + ) ) checkSignature( @@ -60,109 +60,109 @@ class PrettyPrintSuite extends BaseCompletionSuite { "def foo@@(duck: {def quack(): Unit}): Unit", // NOTE(olafur): the ideal output would be without the redunant `AnyRef` but we need to implement // our own pretty-printer to fix that. - "def foo(duck: AnyRef{def quack(): Unit}): Unit", + "def foo(duck: AnyRef{def quack(): Unit}): Unit" ) checkSignature( "int-literal", "def foo@@ = 42", - "override def foo: Int", + "override def foo: Int" ) checkSignature( "string-literal", "def foo@@ = \"foo\"", - "override def foo: String", + "override def foo: String" ) checkSignature( "int-val-literal", "val foo@@ = 42", - "override val foo: Int", + "override val foo: Int" ) checkSignature( "int-val-literal", "def foo@@: Int with String", - "def foo: Int with String", + "def foo: Int with String" ) checkSignature( "annotated", "def foo@@: Int @deprecated(\"\", \"\") ", - "def foo: Int", + "def foo: Int" ) checkSignature( "by-name", "def foo@@(x: => Int): Unit", - "def foo(x: => Int): Unit", + "def foo(x: => Int): Unit" ) checkSignature( "vararg", "def foo@@(x: Int*): Unit", - "def foo(x: Int*): Unit", + "def foo(x: Int*): Unit" ) checkSignature( "forSome", "def foo@@: Option[T] forSome { type T }", - "def foo: Option[_]", + "def foo: Option[_]" ) checkSignature( "forSome2", "def foo@@: Option[T] forSome { type T <: Int }", - "def foo: Option[_ <: Int]", + "def foo: Option[_ <: Int]" ) checkSignature( "forSome3", "def foo@@: Map[T, T] forSome { type T <: Int }", - "def foo: Map[T,T] forSome { type T <: Int }", + "def foo: Map[T,T] forSome { type T <: Int }" ) checkSignature( "function", "def foo@@(fn: Int => String): Unit", - "def foo(fn: Int => String): Unit", + "def foo(fn: Int => String): Unit" ) checkSignature( "tuple", "def foo@@(tuple: (Int, String)): Unit", - "def foo(tuple: (Int, String)): Unit", + "def foo(tuple: (Int, String)): Unit" ) checkSignature( "upper-bound", "def foo@@[T <: CharSequence](arg: T): T", - "def foo[T <: CharSequence](arg: T): T", + "def foo[T <: CharSequence](arg: T): T" ) checkSignature( "lower-bound", "def foo@@[T >: CharSequence](arg: T): T", - "def foo[T >: CharSequence](arg: T): T", + "def foo[T >: CharSequence](arg: T): T" ) checkSignature( "upper-lower-bound", "def foo@@[T >: String <: CharSequence](arg: T): T", - "def foo[T >: String <: CharSequence](arg: T): T", + "def foo[T >: String <: CharSequence](arg: T): T" ) checkSignature( "context-bound", "def foo@@[T:Ordering](arg: T): T", - "def foo[T: Ordering](arg: T): T", + "def foo[T: Ordering](arg: T): T" ) checkSignature( "view-bound", "def foo@@[T <% String](arg: T): T", // View bounds are not resugared into `<% String` because they're considered a bad practice. - "def foo[T](arg: T)(implicit evidence$1: T => String): T", + "def foo[T](arg: T)(implicit evidence$1: T => String): T" ) } diff --git a/tests/cross/src/test/scala/tests/pc/SelectionRangeCommentSuite.scala b/tests/cross/src/test/scala/tests/pc/SelectionRangeCommentSuite.scala index b124ec8d71c..0c945cad355 100644 --- a/tests/cross/src/test/scala/tests/pc/SelectionRangeCommentSuite.scala +++ b/tests/cross/src/test/scala/tests/pc/SelectionRangeCommentSuite.scala @@ -30,8 +30,8 @@ class SelectionRangeCommentSuite extends BaseSelectionRangeSuite { | b <- Some(2) | } yield a + b< println("Hello! " + name) | case None => | } - |}< @@ -86,9 +86,9 @@ class SelectionRangeSuite extends BaseSelectionRangeSuite { | case Some(name) => println("Hello! " + name) | case None => | } - |}< List( @@ -174,9 +174,9 @@ class SelectionRangeSuite extends BaseSelectionRangeSuite { | a <- Some(1) | b <- Some(2) | } yield a + b - |}< "ListBuffer - scala.collection.mutable" - ), + ) ) } diff --git a/tests/cross/src/test/scala/tests/pc/SignatureHelpDocSuite.scala b/tests/cross/src/test/scala/tests/pc/SignatureHelpDocSuite.scala index ed137277803..75f3f4ac21e 100644 --- a/tests/cross/src/test/scala/tests/pc/SignatureHelpDocSuite.scala +++ b/tests/cross/src/test/scala/tests/pc/SignatureHelpDocSuite.scala @@ -63,7 +63,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { | ^^^^^^^^^^^ | @param ifEmpty the expression to evaluate if empty. | @param f the function to apply if nonempty. - """.stripMargin, + """.stripMargin ) checkDoc( @@ -93,7 +93,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { | @param ifEmpty the expression to evaluate if empty. | @param f the function to apply if nonempty. |""".stripMargin - ), + ) ) val addedSpace: String = { @@ -189,8 +189,8 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { | Returns `z` if this collection is empty. |foldLeft[B](z: B)(op: (B, Int) => B): B | ^^^^^^^^^^^^^^^^^ - |""".stripMargin, - ), + |""".stripMargin + ) ) checkDoc( @@ -204,7 +204,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { """| |curry(a: Int, b: Int)(c: Int): Int | ^^^^^^ - |""".stripMargin, + |""".stripMargin ) checkDoc( @@ -214,45 +214,45 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { | List(1).map(x => @@) |} """.stripMargin, - """|Builds a new collection by applying a function to all elements of this collection. + """|Builds a new collection by applying a function to all elements of this general collection. | | |**Type Parameters** |- `B`: the element type of the returned collection. + |- `That`: the class of the returned collection. Where possible, `That` is + |the same class as the current collection class `Repr`, but this + |depends on the element type `B` being admissible for that class, + |which means that an implicit instance of type `CanBuildFrom[Repr, B, That]` + |is found. | |**Parameters** |- `f`: the function to apply to each element. + |- `bf`: an implicit value of class `CanBuildFrom` which determines + |the result class `That` from the current representation type `Repr` and + |the new element type `B`. | - |**Returns:** a new collection resulting from applying the given function - | `f` to each element of this collection and collecting the results. - |map[B](f: Int => B): List[B] - | ^^^^^^^^^^^ + |**Returns:** a new general collection resulting from applying the given function + | `f` to each element of this general collection and collecting the results. + |map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That + | ^^^^^^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> - """|Builds a new collection by applying a function to all elements of this general collection. + ">=2.13.0" -> + """|Builds a new collection by applying a function to all elements of this collection. | | |**Type Parameters** |- `B`: the element type of the returned collection. - |- `That`: the class of the returned collection. Where possible, `That` is - |the same class as the current collection class `Repr`, but this - |depends on the element type `B` being admissible for that class, - |which means that an implicit instance of type `CanBuildFrom[Repr, B, That]` - |is found. | |**Parameters** |- `f`: the function to apply to each element. - |- `bf`: an implicit value of class `CanBuildFrom` which determines - |the result class `That` from the current representation type `Repr` and - |the new element type `B`. | - |**Returns:** a new general collection resulting from applying the given function - | `f` to each element of this general collection and collecting the results. - |map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That - | ^^^^^^^^^^^ + |**Returns:** a new collection resulting from applying the given function + | `f` to each element of this collection and collecting the results. + |map[B](f: Int => B): List[B] + | ^^^^^^^^^^^ |""".stripMargin - ), + ) ) checkDoc( @@ -300,8 +300,8 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |apply[A](x: A): Option[A] | ^^^^ | @param x the value - |""".stripMargin, - ), + |""".stripMargin + ) ) checkDoc( @@ -333,8 +333,8 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |singleton[T](o: T): java.util.Set[T] | ^^^^ | @param o o the sole object to be stored in the returned set. - |""".stripMargin, - ), + |""".stripMargin + ) ) checkDoc( @@ -384,7 +384,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { | @param fin Finally logic which if defined will be invoked after catch logic | @param rethrow Predicate on throwables determining when to rethrow a caught [Throwable](Throwable) |""".stripMargin - ), + ) ) check( @@ -406,7 +406,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |File(parent: String, child: String) |File(pathname: String) |""".stripMargin - ), + ) ) check( @@ -426,7 +426,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |substring(beginIndex: Int): String | ^^^^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -460,7 +460,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |valueOf(data: Array[Char]): String |valueOf(obj: Object): String |""".stripMargin - ), + ) ) check( @@ -505,8 +505,8 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |valueOf(data: Array[Char], offset: Int, count: Int): String |valueOf(data: Array[Char]): String |valueOf(obj: Object): String - |""".stripMargin, - ), + |""".stripMargin + ) ) checkDoc( @@ -527,8 +527,14 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { | `A`. |Some[A](value: A) | ^^^^^^^^ + |""".stripMargin, + "2.11" -> + """|Class `Some[A]` represents existing values of type + | `A`. + |(x: Int): Some[Int] + | ^^^^^^ |""".stripMargin - ), + ) ) checkDoc( @@ -546,6 +552,6 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite { |**Returns:** a new range with a different step |by(step: Int): Range | ^^^^^^^^^ - |""".stripMargin, + |""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/pc/SignatureHelpPatternSuite.scala b/tests/cross/src/test/scala/tests/pc/SignatureHelpPatternSuite.scala index 01f5e12ce06..8290aed4ccb 100644 --- a/tests/cross/src/test/scala/tests/pc/SignatureHelpPatternSuite.scala +++ b/tests/cross/src/test/scala/tests/pc/SignatureHelpPatternSuite.scala @@ -13,15 +13,14 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { | } |} |""".stripMargin, - """|map[B](f: ((Int, Int)) => B): List[B] - | ^^^^^^^^^^^^^^^^^^^^ + """|map[B, That](f: ((Int, Int)) => B)(implicit bf: CanBuildFrom[List[(Int, Int)],B,That]): That + | ^^^^^^^^^^^^^^^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> - """|map[B, That](f: ((Int, Int)) => B)(implicit bf: CanBuildFrom[List[(Int, Int)],B,That]): That - | ^^^^^^^^^^^^^^^^^^^^ - |""".stripMargin - ), + ">=2.13.0" -> """|map[B](f: ((Int, Int)) => B): List[B] + | ^^^^^^^^^^^^^^^^^^^^ + |""".stripMargin + ) ) check( @@ -37,7 +36,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|(Int) | ^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -58,7 +57,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """|(a: T, b: T) | ^^^^ |""".stripMargin - ), + ) ) check( @@ -79,7 +78,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """|(a: C[T]) | ^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -102,7 +101,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """|(a: Int, b: String) | ^^^^^^ |""".stripMargin - ), + ) ) check( @@ -124,7 +123,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|(Int, String) | ^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -144,7 +143,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|(Int, Int) | ^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -164,7 +163,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|(Int, Int) | ^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -186,7 +185,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """|(name: String, age: Int) | ^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -206,7 +205,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """.stripMargin, """|(String, Int) | ^^^^^^ - | """.stripMargin, + | """.stripMargin ) check( @@ -233,8 +232,8 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { |""".stripMargin, "3" -> """|(List[String]) | ^^^^^^^^^^^^ - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -253,7 +252,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|(String, String) | ^^^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -283,8 +282,8 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { "3" -> """|(String, String) | ^^^^^^ - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -304,7 +303,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """.stripMargin, """|(Int) | ^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -328,7 +327,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """|(Option[Int]) | ^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -343,7 +342,7 @@ class SignatureHelpPatternSuite extends BaseSignatureHelpSuite { """.stripMargin, """|unapply[A](a: A): Some[(A, A)] | ^^^^ - | """.stripMargin, + | """.stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/pc/SignatureHelpSuite.scala b/tests/cross/src/test/scala/tests/pc/SignatureHelpSuite.scala index c060fef7840..b6cd7c81e85 100644 --- a/tests/cross/src/test/scala/tests/pc/SignatureHelpSuite.scala +++ b/tests/cross/src/test/scala/tests/pc/SignatureHelpSuite.scala @@ -21,7 +21,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |assert(assertion: Boolean, message: => Any): Unit | ^^^^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( "empty", @@ -40,7 +40,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | ^^^^^^^^^^^^^^^^^^ |assert(assertion: Boolean, message: => Any): Unit |""".stripMargin - ), + ) ) check( "erroneous", @@ -51,7 +51,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|fold[B](ifEmpty: => B)(f: Int => B): B | ^^^^^^^^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -61,15 +61,15 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | List(1).map(@@) |} """.stripMargin, - """|map[B](f: Int => B): List[B] - | ^^^^^^^^^^^ + """|map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That + | ^^^^^^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> - """|map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That - | ^^^^^^^^^^^ + ">=2.13.0" -> + """|map[B](f: Int => B): List[B] + | ^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -91,7 +91,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |Random(seed: Long) |Random(self: java.util.Random) |""".stripMargin - ), + ) ) check( @@ -109,7 +109,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | ^^^^^^^^^^^^ |ProcessBuilder(x$0: java.util.List[String]) |""".stripMargin - ), + ) ) check( @@ -126,8 +126,11 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|Some[A](value: A) | ^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> """|(x: Int): Some[Int] + | ^^^^^^ + |""".stripMargin + ) ) check( @@ -151,7 +154,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |File(x$0: String, x$1: String) |File(x$0: String) |""".stripMargin - ), + ) ) check( "ctor4", @@ -173,7 +176,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |File(x$0: String, x$1: String) |File(x$0: String) |""".stripMargin - ), + ) ) check( @@ -188,7 +191,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|apply(b: String): String | ^^^^^^^^^ |apply(a: Int): Int - |""".stripMargin, + |""".stripMargin ) check( "partial", @@ -207,7 +210,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|collect[B](pf: PartialFunction[Int, B]): Option[B] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -219,7 +222,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|apply[A](x: A): Option[A] | ^^^^ - |""".stripMargin, + |""".stripMargin ) check( "nested2", @@ -228,15 +231,15 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | List(Opt@@ion(1)) |} """.stripMargin, - """|apply[A](elems: A*): List[A] - | ^^^^^^^^^ + """|apply[A](xs: A*): List[A] + | ^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> - """|apply[A](xs: A*): List[A] - | ^^^^^^ + ">=2.13.0" -> + """|apply[A](elems: A*): List[A] + | ^^^^^^^^^ |""".stripMargin - ), + ) ) check( "nested3", @@ -247,7 +250,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|apply[A](x: A): Option[A] | ^^^^ - |""".stripMargin, + |""".stripMargin ) check( // https://github.com/lampepfl/dotty/issues/15244 @@ -260,14 +263,14 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | List(1, 2@@ |} """.stripMargin, - """|apply[A](elems: A*): List[A] - | ^^^^^^^^^ + """|apply[A](xs: A*): List[A] + | ^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> """|apply[A](xs: A*): List[A] - | ^^^^^^ - |""".stripMargin - ), + ">=2.13.0" -> """|apply[A](elems: A*): List[A] + | ^^^^^^^^^ + |""".stripMargin + ) ) check( @@ -281,7 +284,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|identity[A](x: A): A | ^ - |""".stripMargin, + |""".stripMargin ) check( @@ -295,7 +298,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|empty[A]: Option[A] | ^ - |""".stripMargin, + |""".stripMargin ) check( @@ -309,7 +312,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|apply[A](x: A): Option[A] | ^ - |""".stripMargin, + |""".stripMargin ) check( @@ -327,8 +330,11 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { compat = Map( "3" -> """|empty[K, V]: Map[K, V] | ^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> """|empty[A, B]: Map[A,B] + | ^ + |""".stripMargin + ) ) check( @@ -351,8 +357,8 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|lengthCompare(len: Int): Int | ^^^^^^^^ |lengthCompare(that: Iterable[?]): Int - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -371,7 +377,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|apply[K, V](elems: (K, V)*): Map[K, V] | ^^^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( "for", @@ -386,7 +392,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | } yield l |} """.stripMargin, - "", + "" ) check( @@ -403,7 +409,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|apply[A](x: A): Option[A] | ^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -439,7 +445,14 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |to(end: Int): scala.collection.immutable.Range.Inclusive |to(end: Int, step: Int): scala.collection.immutable.Range.Inclusive |""".stripMargin, - ), + "2.11" -> """|^^^^^^ + |to(end: Int): immutable.Range.Inclusive + |to(end: Int, step: Int): immutable.Range.Inclusive + |to(end: T): NumericRange.Inclusive[T] + |to(end: T): Range.Partial[T,NumericRange[T]] + |to(end: T, step: T): NumericRange.Inclusive[T] + |""".stripMargin + ) ) check( @@ -452,6 +465,11 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|applyOrElse[K1 <: Int, V1 >: String](x: K1, default: K1 => V1): V1 | ^^^^^ |""".stripMargin, + compat = Map( + "2.11" -> """|applyOrElse[A1 <: Int, B1 >: String](x: A1, default: A1 => B1): B1 + | ^^^^^ + |""".stripMargin + ) ) check( @@ -469,8 +487,8 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|apply[K, V](elems: (K, V)*): Map[K, V] | ^^^^^^^^^^^^^^ - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -513,8 +531,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|apply(viewId: String, nodeUri: String, label: String, command: String, icon: String, tooltip: String, collapseState: String): case-class.TreeViewNode | ^^^^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -555,8 +574,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|apply(viewId: String, nodeUri: String, label: String, command: String, collapseState: String): case-class2.TreeViewNode | ^^^^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -575,7 +595,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|apply(name: String, age: Int): named.User | ^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -594,7 +614,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|apply(name: String, age: Int): named1.User | ^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -607,7 +627,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|user(name: String, age: Int): Int | ^^^^^^^^^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -629,7 +649,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | ^^^^^^^^^^^ |user(name: String, age: Int): Int |""".stripMargin - ), + ) ) check( @@ -641,7 +661,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|identity[A](x: A): A | ^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -660,7 +680,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|Catch[T](pf: scala.util.control.Exception.Catcher[T], fin: Option[scala.util.control.Exception.Finally], rethrow: Throwable => Boolean) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -682,8 +702,8 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|computeIfAbsent(x$0: String, x$1: java.util.function.Function[? >: String, ? <: Int]): Int | ^^^^^^^^^^^ - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -697,7 +717,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """| |curry(a: Int)(c: Int): Int | ^^^^^^ - |""".stripMargin, + |""".stripMargin ) check( "last-arg", @@ -708,7 +728,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|apply[A](x: A): Option[A] | ^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -718,15 +738,15 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | List[Int]("").map(a => @@) |} """.stripMargin, - """|map[B](f: Int => B): List[B] - | ^^^^^^^^^^^ + """|map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That + | ^^^^^^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> - """|map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That - | ^^^^^^^^^^^ + ">=2.13.0" -> + """|map[B](f: Int => B): List[B] + | ^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -736,15 +756,15 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { | List(1).map(a => 2 @@) |} """.stripMargin, - """|map[B](f: Int => B): List[B] - | ^^^^^^^^^^^ + """|map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That + | ^^^^^^^^^^^ |""".stripMargin, compat = Map( - "2.12" -> - """|map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That - | ^^^^^^^^^^^ + ">=2.13.0" -> + """|map[B](f: Int => B): List[B] + | ^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -769,7 +789,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|map[G[_$3]](fn: Int => G[Int])(using T: last-arg3.TypeClass[F]): G[Int] | ^^^^^^^^^^^^^^^^^ |""".stripMargin - ), + ) ) check( @@ -783,7 +803,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """.stripMargin, """|empty[T: ClassTag]: Array[T] | ^^^^^^^^^^^ - | """.stripMargin, + | """.stripMargin ) check( @@ -806,7 +826,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|conv[T](e: T): implicit-conv.Text[T] | ^^^^ |""".stripMargin - ), + ) ) check( @@ -826,7 +846,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|Map[K, V]: Map | ^ | """.stripMargin - ), + ) ) check( @@ -846,7 +866,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|Map[K, V]: Map | ^ | """.stripMargin - ), + ) ) check( @@ -864,7 +884,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { """|identity[A](x: A): A | ^^^^ |""".stripMargin - ), + ) ) check( @@ -876,7 +896,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|identity[A](x: A): A | ^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -895,8 +915,8 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|fold[B](ifEmpty: => B)(f: Int => B): B | ^^^^^^^^^^^^^ - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -908,7 +928,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|fold[B](ifEmpty: => B)(f: Int => B): B | ^^^^^^^^^^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -922,7 +942,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|fold[B](ifEmpty: => B)(f: Int => B): B | ^^^^^^^^^^^ - |""".stripMargin, + |""".stripMargin ) check( @@ -949,8 +969,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|deployment(fst: String, snd: Int): Option[Int] | ^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -971,8 +992,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|deployment(fst: String, snd: Int): Option[Int] | ^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -995,8 +1017,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|deployment(str: String)(fst: String, snd: Int): Option[Int] | ^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -1019,8 +1042,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|deployment(str: String)(opt: Option[Int])(fst: String, snd: Int): Option[Int] | ^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -1043,8 +1067,9 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { "3" -> """|deployment(str: String)(opt: Option[Int])(fst: String, snd: Int): Option[Int] | ^^^^^^^^^^^^^^^^ - |""".stripMargin - ), + |""".stripMargin, + "2.11" -> "" + ) ) check( @@ -1062,7 +1087,7 @@ class SignatureHelpSuite extends BaseSignatureHelpSuite { |""".stripMargin, """|deployment(using str: String)(fst: String, snd: Int): Option[Int] | ^^^^^^^^^^^ - |""".stripMargin, + |""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/tokens/SemanticTokensScala3Suite.scala b/tests/cross/src/test/scala/tests/tokens/SemanticTokensScala3Suite.scala index 72d352ad7ef..df3f0347e47 100644 --- a/tests/cross/src/test/scala/tests/tokens/SemanticTokensScala3Suite.scala +++ b/tests/cross/src/test/scala/tests/tokens/SemanticTokensScala3Suite.scala @@ -14,7 +14,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { |enum <>/*enum,abstract*/: | case <>/*enum*/, <>/*enum*/ |object <>/*class*/ - |""".stripMargin, + |""".stripMargin ) check( @@ -26,7 +26,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { | case <>/*enum*/(<>/*variable,declaration,readonly*/: <>/*class,abstract*/, <>/*variable,declaration,readonly*/: <>/*class,abstract*/) | case <>/*enum*/(<>/*variable,declaration,readonly*/: <>/*class,abstract*/, <>/*variable,declaration,readonly*/: <>/*class,abstract*/, <>/*variable,declaration,readonly*/: <>/*class,abstract*/) | - |""".stripMargin, + |""".stripMargin ) // Issue: Sequential parameters are not highlighted @@ -37,7 +37,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { | |def <>/*method,definition*/(<>/*parameter,declaration,readonly*/: <>/*class,abstract*/*) = <>/*parameter,readonly*/.<>/*method*/(<<_>>/*parameter,readonly*/ <<+>>/*method*/ 1) |val <>/*variable,definition,readonly*/ = <>/*method*/(xs = 1,2,3) - |""".stripMargin, + |""".stripMargin ) // Issue: Structural types are not highlighted @@ -88,7 +88,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { | <>/*variable,readonly*/.<>/*method*/ |end StructuralTypes |""".stripMargin - ), + ) ) check( @@ -100,7 +100,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { | var <>/*variable,definition*/ = 2 | val <>/*variable,definition,readonly*/ = <>/*class*/(1,<>/*variable,readonly*/,<>/*variable*/) | <>/*variable*/ = <>/*variable,readonly*/ - |""".stripMargin, + |""".stripMargin ) check( @@ -111,7 +111,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { | val <>/*variable,definition,readonly*/ = <>/*class*/(1,2) | val <>/*variable,definition,readonly*/ = <>/*class*/(1,2,3) | val <>/*variable,definition,readonly*/ = <>/*class*/(1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -121,7 +121,7 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { |object <>/*class*/ { | val <>/*variable,definition,readonly*/ = <>/*class*/(1,2) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -137,13 +137,13 @@ class SemanticTokensScala3Suite extends BaseSemanticTokensSuite { |object <>/*class*/ { | type <<@@>>/*type,definition*/ = <>/*class,abstract*/ |} - |""".stripMargin, + |""".stripMargin ) check( "main-annot", """|@<
>/*class*/ def <
>/*method,definition*/(<>/*parameter,declaration,readonly*/: <>/*class*/[<>/*type*/]): <>/*class,abstract*/ = () - |""".stripMargin, + |""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/tokens/SemanticTokensSuite.scala b/tests/cross/src/test/scala/tests/tokens/SemanticTokensSuite.scala index 56ed4a6b987..0461cbfaffd 100644 --- a/tests/cross/src/test/scala/tests/tokens/SemanticTokensSuite.scala +++ b/tests/cross/src/test/scala/tests/tokens/SemanticTokensSuite.scala @@ -31,7 +31,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | <>/*method*/(<>/*parameter,readonly*/) | } |} - |""".stripMargin, + |""".stripMargin ) check( @@ -66,7 +66,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | } |} |""".stripMargin - ), + ) ) check( @@ -108,7 +108,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | } |} |""".stripMargin - ), + ) ) check( @@ -188,7 +188,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | | |""".stripMargin - ), + ) ) check( @@ -203,7 +203,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | <>/*method*/("Hello, world!"<<+>>/*method*/ <>/*variable,readonly*/) | } |} - |""".stripMargin, + |""".stripMargin ) check( "import(Out of File)", @@ -217,7 +217,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | = <>/*class*/(<>/*parameter,readonly*/) |} | - |""".stripMargin, + |""".stripMargin ) check( @@ -250,7 +250,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | override def <>/*method,definition*/(<>/*parameter,declaration,readonly*/: <>/*type*/): <>/*class,abstract*/ = 321 | } |}""".stripMargin - ), + ) ) check( @@ -262,7 +262,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { |class <>/*class*/ { | // rename reference | <>/*class*/(null) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -277,7 +277,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | case <>/*class*/(<>/*variable,definition,readonly*/) => <>/*variable,readonly*/ | case <>/*variable,definition,readonly*/ => | } - |}""".stripMargin, + |}""".stripMargin ) check( @@ -290,7 +290,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | val <>/*class*/(<>/*variable,definition,readonly*/) = <>/*variable,readonly*/ | val <>/*class*/(<>/*variable,definition,readonly*/) = <>/*variable,readonly*/ |} - |""".stripMargin, + |""".stripMargin ) // When for-comprehension includes line with `=`, we get `scala.x$1`, `scala.x$2` symbols on `foo`. @@ -318,7 +318,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | } yield <>/*variable,readonly*/ |} |""".stripMargin - ), + ) ) check( @@ -329,7 +329,7 @@ class SemanticTokensSuite extends BaseSemanticTokensSuite { | <<`type`>>/*parameter,readonly*/ = "abc" | ) |} - |""".stripMargin, + |""".stripMargin ) } diff --git a/tests/cross/src/test/scala/tests/typedef/TypeDefinitionSuite.scala b/tests/cross/src/test/scala/tests/typedef/TypeDefinitionSuite.scala index 47cac5c56d2..fa674fc2b68 100644 --- a/tests/cross/src/test/scala/tests/typedef/TypeDefinitionSuite.scala +++ b/tests/cross/src/test/scala/tests/typedef/TypeDefinitionSuite.scala @@ -34,7 +34,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | val tst = new TClass(2) |}""".stripMargin - ), + ) ) check( @@ -48,7 +48,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | if y < /*scala/Int# Int.scala*/@@x | } yield y |} - |""".stripMargin, + |""".stripMargin ) check( @@ -60,7 +60,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | y <- Option(x) | } yield y |} - |""".stripMargin, + |""".stripMargin ) check( @@ -72,7 +72,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | y /*scala/Option# Option.scala*/@@<- Option(x) | } yield y |} - |""".stripMargin, + |""".stripMargin ) check( @@ -85,7 +85,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | /*scala/Option#WithFilter# Option.scala*/@@if y > 2 | } yield y |} - |""".stripMargin, + |""".stripMargin ) check( @@ -108,7 +108,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | tst(new TClass(2)) |} |""".stripMargin - ), + ) ) check( @@ -118,7 +118,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | val increment: Int => Int = _ + 2 | incre/*scala/Int# Int.scala*/@@ment(1) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -128,7 +128,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | @@(1, 2) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -137,7 +137,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | def tst(): Unit = {} | | ts@@/*scala/Unit# Unit.scala*/t() - |}""".stripMargin, + |}""".stripMargin ) check( @@ -146,7 +146,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | def tst(par1: Int, par2: String, par3: Boolean): Unit = {} | | tst(1, p/*scala/Boolean# Boolean.scala*/@@ar3 = true, par2 = "") - |}""".stripMargin, + |}""".stripMargin ) check( @@ -155,7 +155,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | def tst(par1: Int, par2: String): Unit = {} | | tst(p/*scala/Predef.String# Predef.scala*/@@ar2 = "foo", par1 = 1) - |}""".stripMargin, + |}""".stripMargin ) check( @@ -165,7 +165,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | | foo(a/*scala/Int# Int.scala*/@@rg = 42) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -180,7 +180,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | assert(a/*scala/Boolean# Boolean.scala*/@@ssertion = true) |} |""".stripMargin - ), + ) ) check( @@ -188,7 +188,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { """|object Main { | List(1).hea/*scala/Int# Int.scala*/@@d |} - |""".stripMargin, + |""".stripMargin ) check( @@ -203,7 +203,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | class <<>>Foo(val x: Int) |} |""".stripMargin - ), + ) ) check( @@ -211,7 +211,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { """|object Main { | va@@l x = 42 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -219,7 +219,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { """|object Main { | val x = 4/*scala/Int# Int.scala*/@@2 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -227,20 +227,20 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { """|object Main { | for { | x <- List(1) - | i/*scala/collection/WithFilter# WithFilter.scala*/@@f x > 1 + | i/*scala/collection/generic/FilterMonadic# FilterMonadic.scala*/@@f x > 1 | } println(x) |} |""".stripMargin, compat = Map( - "2.12" -> + ">=2.13.0" -> """|object Main { | for { | x <- List(1) - | i/*scala/collection/generic/FilterMonadic# FilterMonadic.scala*/f x > 1 + | i/*scala/collection/WithFilter# WithFilter.scala*/f x > 1 | } println(x) |} |""".stripMargin - ), + ) ) check( @@ -248,7 +248,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { """|object Main { | "".stripS/*java/lang/String# String.java*/@@uffix("foo") |} - |""".stripMargin, + |""".stripMargin ) check( @@ -263,7 +263,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | def foo[<<>>T](param: T): T = param |} |""".stripMargin - ), + ) ) check( @@ -274,7 +274,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | println(A.fo/*scala/Int# Int.scala*/@@o(2)) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -296,8 +296,8 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | /*scala/collection/immutable/List# List.scala*/List(1) |} - |""".stripMargin, - ), + |""".stripMargin + ) ) check( @@ -306,7 +306,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | ne@@w java.io.File("") |} - |""".stripMargin, + |""".stripMargin ) check( @@ -314,7 +314,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { """| |object Main ex@@tends java.io.Serializable { |} - |""".stripMargin, + |""".stripMargin ) check( @@ -331,7 +331,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { |} |""".stripMargin - ), + ) ) check( @@ -340,7 +340,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |imp@@ort scala.concurrent.Future |object Main { |} - |""".stripMargin, + |""".stripMargin ) check( @@ -349,7 +349,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |import scala.co@@ncurrent.Future |object Main { |} - |""".stripMargin, + |""".stripMargin ) check( @@ -358,7 +358,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | val lst = 1 /*scala/collection/immutable/List# List.scala*/@@:: Nil |} - |""".stripMargin, + |""".stripMargin ) check( @@ -367,7 +367,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | val n = ma@@th.max(1, 2) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -376,7 +376,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | List(1).map(/*scala/Int# Int.scala*/@@_ + 2) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -385,7 +385,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | List(1).foldLeft(0)(_ + /*scala/Int# Int.scala*/@@_) |} - |""".stripMargin, + |""".stripMargin ) check( @@ -394,7 +394,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |object Main { | def x: /*scala/Int# Int.scala*/@@Int = 42 |} - |""".stripMargin, + |""".stripMargin ) check( @@ -403,7 +403,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { |class Main { | val all = Option(42)./*scala/Int# Int.scala*/@@get :: List("1", "2") |} - |""".stripMargin, + |""".stripMargin ) check( @@ -424,7 +424,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | hello(User()) |} |""".stripMargin - ), + ) ) check( @@ -445,7 +445,7 @@ class TypeDefinitionSuite extends BasePcDefinitionSuite { | hello(new Us@@er()) |} |""".stripMargin - ), + ) ) } diff --git a/tests/mtest/src/main/scala/tests/Assertions.scala b/tests/mtest/src/main/scala/tests/Assertions.scala index bff97dc093a..07e8dd470f2 100644 --- a/tests/mtest/src/main/scala/tests/Assertions.scala +++ b/tests/mtest/src/main/scala/tests/Assertions.scala @@ -34,7 +34,7 @@ trait Assertions extends munit.Assertions { def assertDiffNotEqual[T]( obtained: T, expected: T, - hint: String = "", + hint: String = "" )(implicit loc: Location): Unit = { if (obtained == expected) { val hintMsg = if (hint.isEmpty) "" else s" (hint: $hint)" diff --git a/tests/mtest/src/main/scala/tests/BaseSuite.scala b/tests/mtest/src/main/scala/tests/BaseSuite.scala index 5892b842e07..ba74663b83c 100644 --- a/tests/mtest/src/main/scala/tests/BaseSuite.scala +++ b/tests/mtest/src/main/scala/tests/BaseSuite.scala @@ -49,7 +49,7 @@ abstract class BaseSuite extends munit.FunSuite with Assertions { def isValidScalaVersionForEnv(scalaVersion: String): Boolean = this.isJava8 || SemVer.isCompatibleVersion( BaseSuite.minScalaVersionForJDK9OrHigher, - scalaVersion, + scalaVersion ) || scalaVersion.startsWith("3.") override def munitTimeout: Duration = Duration("10min") @@ -63,9 +63,9 @@ abstract class BaseSuite extends munit.FunSuite with Assertions { "FlakyWindows", test => if (test.tags(FlakyWindows) && Properties.isWin) test.tag(Flaky) - else test, + else test ), - munitFlakyTransform, + munitFlakyTransform ) val compatProcess: Map[String, String => String] = @@ -74,7 +74,7 @@ abstract class BaseSuite extends munit.FunSuite with Assertions { def getExpected( default: String, compat: Map[String, String], - scalaVersion: String, + scalaVersion: String ): String = { val postProcess = compatProcess .collectFirst { @@ -90,7 +90,7 @@ abstract class BaseSuite extends munit.FunSuite with Assertions { def compatOrDefault[A]( default: A, compat: Map[String, A], - scalaVersion: String, + scalaVersion: String ): A = Compat .forScalaVersion(scalaVersion, compat) diff --git a/tests/mtest/src/main/scala/tests/Compat.scala b/tests/mtest/src/main/scala/tests/Compat.scala index e7ce3000035..a99e3bc5505 100644 --- a/tests/mtest/src/main/scala/tests/Compat.scala +++ b/tests/mtest/src/main/scala/tests/Compat.scala @@ -11,7 +11,7 @@ object Compat { */ def forScalaVersion[A]( scalaVersion: String, - cases: Map[String, A], + cases: Map[String, A] ): Option[A] = { val (startsWith, gt) = cases.partition { case (v, _) => !v.startsWith(">=") } @@ -31,7 +31,7 @@ object Compat { private def matchesGte[A]( version: String, - gtCases: Map[String, A], + gtCases: Map[String, A] ): Option[A] = { val parsed = SemVer.Version.fromString(version) val less = gtCases diff --git a/tests/mtest/src/main/scala/tests/DelegatingGlobalSymbolIndex.scala b/tests/mtest/src/main/scala/tests/DelegatingGlobalSymbolIndex.scala index 1f29a1f1c57..6d439242638 100644 --- a/tests/mtest/src/main/scala/tests/DelegatingGlobalSymbolIndex.scala +++ b/tests/mtest/src/main/scala/tests/DelegatingGlobalSymbolIndex.scala @@ -25,19 +25,19 @@ class DelegatingGlobalSymbolIndex( def addSourceFile( file: AbsolutePath, sourceDirectory: Option[AbsolutePath], - dialect: Dialect, + dialect: Dialect ): List[String] = { underlying.addSourceFile(file, sourceDirectory, dialect) } def addSourceJar( jar: AbsolutePath, - dialect: Dialect, + dialect: Dialect ): List[(String, AbsolutePath)] = { underlying.addSourceJar(jar, dialect) } def addSourceDirectory( dir: AbsolutePath, - dialect: Dialect, + dialect: Dialect ): List[(String, AbsolutePath)] = { underlying.addSourceDirectory(dir, dialect) } diff --git a/tests/mtest/src/main/scala/tests/PCSuite.scala b/tests/mtest/src/main/scala/tests/PCSuite.scala index b751ade9026..79f40b5b226 100644 --- a/tests/mtest/src/main/scala/tests/PCSuite.scala +++ b/tests/mtest/src/main/scala/tests/PCSuite.scala @@ -37,8 +37,10 @@ trait PCSuite { .create() .withRepositories(allRepos: _*) - protected def indexJdkSources: Unit = - JdkSources().foreach(jdk => index.addSourceJar(jdk, dialects.Scala213)) + protected def indexJdkSources: Unit = JdkSources() match { + case Right(jdk) => index.addSourceJar(jdk, dialects.Scala213) + case _ => + } protected def extraLibraries(f: Fetch): Seq[Path] = f .fetch() @@ -54,7 +56,7 @@ trait PCSuite { .fromClasspath(myclasspath, ExcludedPackagesHandler.default), new Docstrings(index), workspace, - index, + index ) } @@ -71,7 +73,7 @@ trait PCSuite { def hoverParams( code: String, - filename: String = "test.java", + filename: String = "test.java" ): (String, Int, Int) = { val code2 = code.replace("@@", "").replace("%<%", "").replace("%>%", "") val positionOffset = diff --git a/tests/mtest/src/main/scala/tests/RangeReplace.scala b/tests/mtest/src/main/scala/tests/RangeReplace.scala index 56724295980..866d6f0d89e 100644 --- a/tests/mtest/src/main/scala/tests/RangeReplace.scala +++ b/tests/mtest/src/main/scala/tests/RangeReplace.scala @@ -10,7 +10,7 @@ trait RangeReplace { def renderHighlightsAsString( code: String, - highlights: List[DocumentHighlight], + highlights: List[DocumentHighlight] ): String = { highlights .foldLeft((code, List.empty[(Int, Int)])) { @@ -19,7 +19,7 @@ trait RangeReplace { code, base, location.getRange, - alreadyAddedMarkings, + alreadyAddedMarkings ) } ._1 @@ -29,7 +29,7 @@ trait RangeReplace { base: String, range: Range, prefix: String = "<<", - suffix: String = ">>", + suffix: String = ">>" ): String = replaceInRangeWithAdjustmens(base, base, range, List(), prefix, suffix)._1 @@ -39,7 +39,7 @@ trait RangeReplace { range: Range, alreadyAddedMarkings: List[(Int, Int)], prefix: String = "<<", - suffix: String = ">>", + suffix: String = ">>" ): (String, List[(Int, Int)]) = { val input = Input.String(code) val pos = range @@ -64,8 +64,8 @@ trait RangeReplace { .toString, (pos.start, prefix.length) :: ( pos.end, - suffix.length, - ) :: alreadyAddedMarkings, + suffix.length + ) :: alreadyAddedMarkings ) } diff --git a/tests/mtest/src/main/scala/tests/TestHovers.scala b/tests/mtest/src/main/scala/tests/TestHovers.scala index 536be07dfca..2e92d32b219 100644 --- a/tests/mtest/src/main/scala/tests/TestHovers.scala +++ b/tests/mtest/src/main/scala/tests/TestHovers.scala @@ -18,7 +18,7 @@ trait TestHovers { expressionType, Some(symbolSignature), "", - forceExpressionType = true, + forceExpressionType = true ) case _ => string @@ -34,7 +34,7 @@ trait TestHovers { expressionType, symbolSignature, "", - forceExpressionType = true, + forceExpressionType = true ) case _ => string @@ -50,7 +50,7 @@ trait TestHovers { expressionType, Some(symbolSignature), "", - forceExpressionType = true, + forceExpressionType = true ) case _ => string @@ -60,7 +60,7 @@ trait TestHovers { def renderAsString( code: String, hover: Option[Hover], - includeRange: Boolean, + includeRange: Boolean ): String = { hover match { case Some(value) => @@ -76,7 +76,7 @@ trait TestHovers { ) codeFence( pos.text, - "range", + "range" ) case _ => "" } diff --git a/tests/mtest/src/main/scala/tests/TestSemanticTokens.scala b/tests/mtest/src/main/scala/tests/TestSemanticTokens.scala index 88792d4c114..1ffd08b2092 100644 --- a/tests/mtest/src/main/scala/tests/TestSemanticTokens.scala +++ b/tests/mtest/src/main/scala/tests/TestSemanticTokens.scala @@ -67,7 +67,7 @@ object TestSemanticTokens { val candidates = head :: rest.takeWhile(nxt => nxt.start() == head.start() && isIdentifier( nxt.start(), - nxt.end(), + nxt.end() ) ) val node = candidates.maxBy(node => @@ -107,12 +107,12 @@ object TestSemanticTokens { deltaStartChar, length, tokenType, - tokenModifier, + tokenModifier ) => // modifiers ignored for now ( new l.Position(deltaLine, deltaStartChar), length, - decorationString(tokenType, tokenModifier), + decorationString(tokenType, tokenModifier) ) case _ => throw new RuntimeException("Expected output dividable by 5") @@ -122,7 +122,7 @@ object TestSemanticTokens { @tailrec def toAbsolutePositions( positions: List[(l.Position, Int, String)], - last: l.Position, + last: l.Position ): Unit = { positions match { case (head, _, _) :: next => diff --git a/tests/mtest/src/main/scala/tests/TestingSymbolSearch.scala b/tests/mtest/src/main/scala/tests/TestingSymbolSearch.scala index 5e0a638aa77..be7051dadec 100644 --- a/tests/mtest/src/main/scala/tests/TestingSymbolSearch.scala +++ b/tests/mtest/src/main/scala/tests/TestingSymbolSearch.scala @@ -32,12 +32,12 @@ class TestingSymbolSearch( docs: Docstrings = Docstrings.empty(EmptyReportContext), workspace: TestingWorkspaceSearch = TestingWorkspaceSearch.empty(EmptyReportContext), - index: GlobalSymbolIndex = OnDemandSymbolIndex.empty()(EmptyReportContext), + index: GlobalSymbolIndex = OnDemandSymbolIndex.empty()(EmptyReportContext) )(implicit rc: ReportContext = EmptyReportContext) extends SymbolSearch { override def documentation( symbol: String, - parents: ParentSymbols, + parents: ParentSymbols ): Optional[SymbolDocumentation] = { docs.documentation(symbol, parents) } @@ -54,7 +54,7 @@ class TestingSymbolSearch( ju.Collections.singletonList( new Location( uri, - new Range(new Position(0, 0), new Position(0, 0)), + new Range(new Position(0, 0), new Position(0, 0)) ) ) } @@ -62,7 +62,7 @@ class TestingSymbolSearch( override def definitionSourceToplevels( symbol: String, - source: URI, + source: URI ): ju.List[String] = { index.definition(Symbol(symbol)) match { case None => @@ -77,7 +77,7 @@ class TestingSymbolSearch( override def search( textQuery: String, buildTargetIdentifier: String, - visitor: SymbolSearchVisitor, + visitor: SymbolSearchVisitor ): SymbolSearch.Result = { val query = WorkspaceSymbolQuery.exact(textQuery) workspace.search(query, visitor) @@ -87,7 +87,7 @@ class TestingSymbolSearch( override def searchMethods( textQuery: String, buildTargetIdentifier: String, - visitor: SymbolSearchVisitor, + visitor: SymbolSearchVisitor ): SymbolSearch.Result = { val query = WorkspaceSymbolQuery.exact(textQuery) workspace.search( @@ -95,7 +95,7 @@ class TestingSymbolSearch( visitor, (info: WorkspaceSymbolInformation) => { info.sematicdbKind == s.SymbolInformation.Kind.METHOD - }, + } ) SymbolSearch.Result.COMPLETE } diff --git a/tests/mtest/src/main/scala/tests/TestingWorkspaceSearch.scala b/tests/mtest/src/main/scala/tests/TestingWorkspaceSearch.scala index 577c6980fad..06647fbcb6b 100644 --- a/tests/mtest/src/main/scala/tests/TestingWorkspaceSearch.scala +++ b/tests/mtest/src/main/scala/tests/TestingWorkspaceSearch.scala @@ -26,7 +26,7 @@ class TestingWorkspaceSearch(implicit rc: ReportContext = EmptyReportContext) { def search( query: WorkspaceSymbolQuery, visitor: SymbolSearchVisitor, - filter: WorkspaceSymbolInformation => Boolean = _ => true, + filter: WorkspaceSymbolInformation => Boolean = _ => true ): Unit = for { (path, (text, dialect)) <- inputs @@ -34,7 +34,7 @@ class TestingWorkspaceSearch(implicit rc: ReportContext = EmptyReportContext) { SemanticdbDefinition.foreach( Input.VirtualFile(path, text), dialect, - includeMembers = true, + includeMembers = true ) { defn => if (query.matches(defn.info)) { val c = defn.toCached @@ -43,7 +43,7 @@ class TestingWorkspaceSearch(implicit rc: ReportContext = EmptyReportContext) { Paths.get(path), c.symbol, c.kind, - c.range, + c.range ) } }