Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalameta to 4.9.9 #2024

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,18 @@ lazy val core = projectMatrix
libraryDependencies ++= {
if (isScala3.value) {
List(
scalameta
scalameta,
// CrossVersion.for3Use2_13 would only lookup a binary version artifact, but this is published with full version
semanticdbScalacCore.cross(CrossVersion.constant(scala213))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following scalameta/scalameta#3747, this was added to continue building against internal.{symtab,metap} (now directly via semanticdb-scalac-core) & protobuf stubs in internal.semanticdb (now transitively via semanticb-shared). Unfortunately, this brings way too much stuff: `scala.meta.interactive, other unused (internal) classes, and the Scala2 compiler itself.

If this turns out to be a problem, we could either (1) revisit this upstream, or (2) rely on semanticdb-shared and shade only packages we need from semanticdb-scalac-core.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The biggest problem here I guess is that we are using internal packages, we should move them out of internal if they are intended to be binary compat or as you suggest shade them in scalafix πŸ€”

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I will go for (2). For the record: I'll wait for the next scalameta release I guess (since I am effectively blocked by scalameta/scalameta#3786 (comment)), where semanticdb-shared will be cross-built with binary version only.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was not that easy in the end :( #2048

).map { mod =>
mod
.exclude("com.lihaoyi", "sourcecode_2.13")
.exclude("org.scala-lang.modules", "scala-collection-compat_2.13")
)
}
} else {
List(
scalameta,
semanticdbScalacCore,
collectionCompat
)
}
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object Dependencies {
val metaconfigV = "0.12.0"
val nailgunV = "0.9.1"
val scalaXmlV = "2.2.0"
val scalametaV = "4.9.3"
val scalametaV = "4.9.9"
val scalatestV = "3.2.19"
val munitV = "1.0.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.Optional
import scala.{meta => m}

import scala.meta.inputs.Input
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput

import scalafix.interfaces.ScalafixInput

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import scala.util.control.NoStackTrace
import scala.util.control.NonFatal

import scala.meta.inputs.Input
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.semanticdb.TextDocument
import scala.meta.io.AbsolutePath
import scala.meta.parsers.ParseException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package scalafix.internal.v1
import scala.meta.AbsolutePath
import scala.meta.Input
import scala.meta.Source
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.io.FileIO
import scala.meta.internal.symtab.SymbolTable
import scala.meta.io.RelativePath
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scala.meta.internal

import scala.meta._
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.semanticdb.Scala.Descriptor
import scala.meta.internal.semanticdb.Scala.DescriptorParser
import scala.meta.internal.{semanticdb => s}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scalafix.internal.config

import scala.{meta => m}

import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput

import metaconfig.Conf
import metaconfig.ConfDecoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import scala.collection.mutable.StringBuilder

import scala.meta.Position
import scala.meta.inputs.Input
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput

import scalafix.internal.util.IntervalSet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scalafix.internal.rule

import scala.meta._
import scala.meta.contrib.AssociatedComments
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.tokens.Tokens

import org.scalameta.FileLine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scalafix.internal.util

import scala.meta._
import scala.meta.internal.ScalametaInternals
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.{semanticdb => s}

object PositionSyntax {
Expand Down
2 changes: 1 addition & 1 deletion scalafix-core/src/main/scala/scalafix/v0/Database.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package scalafix.v0

import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.io.PathIO

final case class Database(documents: Seq[Document]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package scalafix.v1

import scala.meta._
import scala.meta.contrib.AssociatedComments
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.symtab.SymbolTable
import scala.meta.internal.{semanticdb => s}
import scala.meta.io.RelativePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.meta.Source
import scala.meta.Tokens
import scala.meta.Tree
import scala.meta.contrib.AssociatedComments
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.parsers.Parsed

import scalafix.internal.config.ScalaVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package scalafix.internal.v0
import scala.{meta => m}

import scala.meta._
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput
import scala.meta.internal.io._
import scala.meta.internal.symtab.SymbolTable
import scala.meta.internal.{semanticdb => s}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package scalafix.testkit
import scala.util.Try

import scala.meta._
import scala.meta.internal.inputs.XtensionInputSyntaxStructure
import scala.meta.internal.inputs.XtensionInput

import metaconfig.Conf
import metaconfig.internal.ConfGet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ class CliSyntacticSuite extends BaseCliSuite {
check(
name = "fix script files",
originalLayout = s"""|/a.sc
|#!/usr/bin/env -S scala-cli shebang
|def foo { println(1) }
|lazy val bar = project
|""".stripMargin,
Expand All @@ -322,6 +323,7 @@ class CliSyntacticSuite extends BaseCliSuite {
"a.sc"
),
expectedLayout = s"""|/a.sc
|#!/usr/bin/env -S scala-cli shebang
|def foo: Unit = { println(1) }
|lazy val bar = project
|""".stripMargin,
Expand Down
Loading