From fe2bbddcef29d305ab320283a2ab1aeced8b5a8d Mon Sep 17 00:00:00 2001 From: Brice Jaglin Date: Fri, 23 Aug 2024 01:24:35 +0200 Subject: [PATCH] document tested support for Scala3 LTS & Scala3 Next --- docs/users/installation.md | 16 +++++++++------- scalafix-docs/src/main/scala/docs/Main.scala | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/users/installation.md b/docs/users/installation.md index 7d1404b9e2..6d349c0662 100644 --- a/docs/users/installation.md +++ b/docs/users/installation.md @@ -5,11 +5,13 @@ title: Installation ## Support -**macOS, Linux or Windows** +Scalafix is tested to work with: -**Java LTS (8, 11, 17 or 21)** +* **macOS, Linux or Windows** +* **Java LTS (8, 11, 17 or 21)** +* **Scala @SCALA212@, @SCALA213@ or @SCALA3LTS@ or @SCALA3NEXT@** -**Scala 2.12, 2.13 or 3.x** +Note that other setups may work, but could result in unexpected behavior. ## sbt @@ -83,7 +85,7 @@ the Scala compiler option `-Ywarn-unused-import` (or `-Wunused:imports` in */ inThisBuild( List( - scalaVersion := "@SCALA212@", // @SCALA213@, or 3.x + scalaVersion := "@SCALA212@", // @SCALA213@, @SCALA3LTS@ or @SCALA3NEXT@ + semanticdbEnabled := true, // enable SemanticDB + semanticdbVersion := scalafixSemanticdb.revision // only required for Scala 2.x ) @@ -106,7 +108,7 @@ the Scala compiler option `-Ywarn-unused-import` (or `-Wunused:imports` in * https://www.scala-sbt.org/1.x/docs/sbt-1.3-Release-Notes.html#SemanticDB+support */ lazy val myproject = project.settings( - scalaVersion := "@SCALA212@", // @SCALA213@, or 3.x + scalaVersion := "@SCALA212@", // @SCALA213@, @SCALA3LTS@ or @SCALA3NEXT@ + semanticdbEnabled := true, // enable SemanticDB + semanticdbVersion := scalafixSemanticdb.revision, // only required for Scala 2.x + scalacOptions += { @@ -403,7 +405,7 @@ settings `scalacOptions` and `allDependencies` contain the values below. ... > show allDependencies ... -[info] List(..., org.scalameta:semanticdb-scalac:@SCALA212@:plugin->default(compile), ...) +[info] List(..., org.scalameta:semanticdb-scalac:@SCALA213@:plugin->default(compile), ...) ... ``` @@ -464,5 +466,5 @@ If using the sbt plugin If using the command-line interface ```sh -cs launch ch.epfl.scala:scalafix-cli_@SCALA212@:@NIGHTLY_VERSION@ -r sonatype:snapshots --main scalafix.cli.Cli -- --help +cs launch ch.epfl.scala:scalafix-cli_@SCALA213@:@NIGHTLY_VERSION@ -r sonatype:snapshots --main scalafix.cli.Cli -- --help ``` diff --git a/scalafix-docs/src/main/scala/docs/Main.scala b/scalafix-docs/src/main/scala/docs/Main.scala index 8dab91f8fc..07c938a3bb 100644 --- a/scalafix-docs/src/main/scala/docs/Main.scala +++ b/scalafix-docs/src/main/scala/docs/Main.scala @@ -39,6 +39,8 @@ sidebar_label: Guide .withSiteVariables( Map( "SEMANTICDB" -> "[SemanticDB](https://scalameta.org/docs/semanticdb/specification.html)", + "SCALA3NEXT" -> Versions.scala3Next.split('.').take(2).mkString("", ".", ".x"), + "SCALA3LTS" -> Versions.scala3LTS.split('.').take(2).mkString("", ".", ".x"), "SCALA213" -> Versions.scala213, "SCALA212" -> Versions.scala212, "NIGHTLY_VERSION" -> Versions.version,