Skip to content

Commit 7570c6c

Browse files
committed
Reclassify -Ysemanticdb as -Xsemanticdb, as it is officially supported.
We keep -Ysemanticdb as an alias (an "abbreviation") so that we do not break all the existing tools that enable that setting.
1 parent f53ba37 commit 7570c6c

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class Compiler {
148148
def newRun(using Context): Run = {
149149
reset()
150150
val rctx =
151-
if ctx.settings.Ysemanticdb.value then
151+
if ctx.settings.Xsemanticdb.value then
152152
ctx.addMode(Mode.ReadPositions)
153153
else
154154
ctx

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
124124
val XverifySignatures: Setting[Boolean] = BooleanSetting("-Xverify-signatures", "Verify generic signatures in generated bytecode.")
125125
val XignoreScala2Macros: Setting[Boolean] = BooleanSetting("-Xignore-scala2-macros", "Ignore errors when compiling code that calls Scala2 macros, these will fail at runtime.")
126126
val XimportSuggestionTimeout: Setting[Int] = IntSetting("-Ximport-suggestion-timeout", "Timeout (in ms) for searching for import suggestions when errors are reported.", 8000)
127+
val Xsemanticdb: Setting[Boolean] = BooleanSetting("-Xsemanticdb", "Store information in SemanticDB.").withAbbreviation("-Ysemanticdb")
127128

128129
val XmixinForceForwarders = ChoiceSetting(
129130
name = "-Xmixin-force-forwarders",
@@ -186,7 +187,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
186187
val YdumpSbtInc: Setting[Boolean] = BooleanSetting("-Ydump-sbt-inc", "For every compiled foo.scala, output the API representation and dependencies used for sbt incremental compilation in foo.inc, implies -Yforce-sbt-phases.")
187188
val YcheckAllPatmat: Setting[Boolean] = BooleanSetting("-Ycheck-all-patmat", "Check exhaustivity and redundancy of all pattern matching (used for testing the algorithm).")
188189
val YretainTrees: Setting[Boolean] = BooleanSetting("-Yretain-trees", "Retain trees for top-level classes, accessible from ClassSymbol#tree")
189-
val Ysemanticdb: Setting[Boolean] = BooleanSetting("-Ysemanticdb", "Store information in SemanticDB.")
190190
val YshowTreeIds: Setting[Boolean] = BooleanSetting("-Yshow-tree-ids", "Uniquely tag all tree nodes in debugging output.")
191191
val YfromTastyIgnoreList: Setting[List[String]] = MultiStringSetting("-Yfrom-tasty-ignore-list", "file", "List of `tasty` files in jar files that will not be loaded when using -from-tasty")
192192

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ExtractSemanticDB extends Phase:
3535
override val phaseName: String = ExtractSemanticDB.name
3636

3737
override def isRunnable(using Context) =
38-
super.isRunnable && ctx.settings.Ysemanticdb.value
38+
super.isRunnable && ctx.settings.Xsemanticdb.value
3939

4040
// Check not needed since it does not transform trees
4141
override def isCheckable: Boolean = false

compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting {
3535
aggregateTests(
3636
compileFilesInDir("tests/bench", defaultOptions),
3737
compileFilesInDir("tests/pos-macros", defaultOptions),
38-
compileFilesInDir("tests/pos-custom-args/semanticdb", defaultOptions.and("-Ysemanticdb")),
38+
compileFilesInDir("tests/pos-custom-args/semanticdb", defaultOptions.and("-Xsemanticdb")),
3939
).checkCompile()
4040
}
4141

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class CompilationTests {
232232
Properties.compilerInterface, Properties.scalaLibrary, Properties.scalaAsm,
233233
Properties.dottyInterfaces, Properties.jlineTerminal, Properties.jlineReader,
234234
).mkString(File.pathSeparator),
235-
Array("-Ycheck-reentrant", "-Yemit-tasty-in-class", "-language:postfixOps", "-Ysemanticdb")
235+
Array("-Ycheck-reentrant", "-Yemit-tasty-in-class", "-language:postfixOps", "-Xsemanticdb")
236236
)
237237

238238
val libraryDirs = List(Paths.get("library/src"), Paths.get("library/src-bootstrapped"))

compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class SemanticdbTests:
107107
val exitJava = javac.run(null, null, null, javaArgs:_*)
108108
assert(exitJava == 0, "java compiler has errors")
109109
val args = Array(
110-
"-Ysemanticdb",
110+
"-Xsemanticdb",
111111
"-d", target.toString,
112112
"-feature",
113113
"-deprecation",

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object TestConfiguration {
1717
"-Yno-deep-subtypes",
1818
"-Yno-double-bindings",
1919
"-Yforce-sbt-phases",
20-
"-Ysemanticdb",
20+
"-Xsemanticdb",
2121
"-Xverify-signatures"
2222
)
2323

docs/docs/contributing/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ with `with-compiler` in their name.
148148

149149
### SemanticDB tests
150150

151-
The output of the `extractSemanticDB` phase, enabled with `-Ysemanticdb` is tested with the bootstrapped JUnit test
151+
The output of the `extractSemanticDB` phase, enabled with `-Xsemanticdb` is tested with the bootstrapped JUnit test
152152
`dotty.tools.dotc.semanticdb.SemanticdbTests`. It uses source files in `tests/semanticdb/expect` to generate
153153
two kinds of output file that are compared with "expect files": placement of semanticdb symbol occurrences inline in
154154
sourcecode (`*.expect.scala`), for human verification by inspection; and secondly metap formatted output which outputs

0 commit comments

Comments
 (0)