Skip to content

Commit

Permalink
chore: Add support for Scala 3.3.3
Browse files Browse the repository at this point in the history
Scala 3.3.2 was broken so we put it straight away to deprecate
  • Loading branch information
tgodzik committed Mar 1, 2024
1 parent 96cfa59 commit 9855505
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 10 deletions.
@@ -0,0 +1,4 @@
package scala.meta.internal.pc

object Compat:
val EvidenceParamName = dotty.tools.dotc.core.NameKinds.ContextBoundParamName
@@ -0,0 +1,30 @@
package scala.meta.internal.pc.printer

import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.Flags.*
import dotty.tools.dotc.core.StdNames.*
import dotty.tools.dotc.core.Types.*
import dotty.tools.dotc.printing.RefinedPrinter
import dotty.tools.dotc.printing.Texts.Text

/* In 3.4.x some changes were made to printer,
but haven't managed to port all of them yet to the LTS */
abstract class RefinedDotcPrinter(_ctx: Context) extends RefinedPrinter(_ctx):

def toTextPrefix(tp: Type) =
tp match
case tp: NamedType => super.toTextPrefixOf(tp)
case tp => Text()

override def toText(tp: Type): Text =
tp match
case tp: TermRef
if !tp.denotationIsCurrent && !homogenizedView ||
tp.symbol.is(Module) || tp.symbol.name == nme.IMPORT =>
toTextPrefix(tp.prefix) ~ selectionString(tp) ~ ".type"
case tp: TermRef =>
toTextPrefix(tp.prefix) ~ selectionString(tp)
case tr: TypeRef =>
super.toText(tr)
case _ => super.toText(tp)
end RefinedDotcPrinter
6 changes: 3 additions & 3 deletions project/V.scala
Expand Up @@ -5,8 +5,8 @@ object V {
val scala211 = "2.11.12"
val scala212 = "2.12.19"
val scala213 = "2.13.13"
val scala3 = "3.3.2"
val firstScala3PCVersion = "3.3.3"
val scala3 = "3.3.3"
val firstScala3PCVersion = "3.3.4"
val wrapperMetalsVersion = "3.4.0-RC1-bin-20231127-41e7d95-NIGHTLY"

// When you can add to removedScalaVersions in MtagsResolver.scala with the last released version
Expand Down Expand Up @@ -115,7 +115,7 @@ object V {

// whenever version is removed please add it to MtagsResolver under last supported Metals version
def deprecatedScala3Versions =
Seq("3.2.1", "3.2.0", "3.1.2", "3.1.1", "3.1.0")
Seq("3.3.2", "3.2.1", "3.2.0", "3.1.2", "3.1.1", "3.1.0")

// NOTE if you had a new Scala Version make sure it's contained in quickPublishScalaVersions
def scala3Versions = nonDeprecatedScala3Versions ++ deprecatedScala3Versions
Expand Down
Expand Up @@ -587,7 +587,7 @@ class CompletionKeywordSuite extends BaseCompletionSuite {
|unsafe - scala.caps (commit: '')
|unsafeNulls - scala.runtime.stdLibPatches.language (commit: '')
|""".stripMargin,
"3.3.2" -> """|using (commit: '')
"3.3.3" -> """|using (commit: '')
|unsafeExceptions scala (commit: '')
|unchecked scala (commit: '')
|unsafe - caps (commit: '')
Expand Down Expand Up @@ -632,7 +632,7 @@ class CompletionKeywordSuite extends BaseCompletionSuite {
|unsafe - scala.caps
|unsafeNulls - scala.runtime.stdLibPatches.language
|unshared(): unshared""".stripMargin,
"3.3.2" -> """|unsafeExceptions scala
"3.3.3" -> """|unsafeExceptions scala
|unchecked scala
|unsafe - caps
|unsafeNulls - scala.runtime.stdLibPatches.language
Expand Down
Expand Up @@ -450,7 +450,7 @@ class CompletionOverrideSuite extends BaseCompletionSuite {
)

checkEdit(
"jlang".tag(IgnoreScalaVersion("3.3.2")),
"jlang".tag(IgnoreScalaVersion("3.3.3")),
"""|abstract class Mutable {
| def foo: java.lang.StringBuilder
|}
Expand Down
Expand Up @@ -67,7 +67,7 @@ class CompletionPatternSuite extends BaseCompletionSuite {
|macros - scala.languageFeature.experimental
|macroImpl - scala.reflect.macros.internal
|""".stripMargin,
"3.3.2" ->
"3.3.3" ->
"""|main scala
|macros - languageFeature.experimental
|macroImpl(referenceToMacroImpl: Any): macroImpl
Expand Down
Expand Up @@ -106,7 +106,7 @@ class CompletionScalaCliSuite extends BaseCompletionSuite {
check(
"plugin".tag(
IgnoreScalaVersion(version =>
Set("2.12.16", "2.12.19", "2.13.13", "3.3.2")(version) ||
Set("2.12.16", "2.12.19", "2.13.13", "3.3.3")(version) ||
version.contains(
"NIGHTLY"
) || version.contains(
Expand Down
Expand Up @@ -452,7 +452,7 @@ class InsertInferredTypeSuite extends BaseCodeActionSuite {
)

checkEdit(
"path".tag(IgnoreScalaVersion("3.3.2")),
"path".tag(IgnoreScalaVersion("3.3.3")),
"""|import java.nio.file.Paths
|object ExplicitResultTypesPrefix {
| class Path
Expand Down
2 changes: 1 addition & 1 deletion tests/mtest/src/main/scala/tests/BaseSuite.scala
Expand Up @@ -20,7 +20,7 @@ abstract class BaseSuite extends munit.FunSuite with Assertions {
val FlakyWindows = new Tag("FlakyWindows")

val scala3PresentationCompilerVersion: String =
s">=3.3.3"
s">=3.3.4"

Testing.enable()

Expand Down

0 comments on commit 9855505

Please sign in to comment.