Skip to content

Commit fae7c09

Browse files
authored
Merge pull request #14589 from SethTisue/delete-dottyide
remove DottyIDE
2 parents eaefd45 + 3c01ded commit fae7c09

26 files changed

+53
-5115
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111

112112
- name: Cmd Tests
113113
run: |
114-
./project/scripts/sbt ";dist/pack; scala3-bootstrapped/compile; scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-test/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test; scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
114+
./project/scripts/sbt ";dist/pack; scala3-bootstrapped/compile; scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-test/scripted scala2-compat/* ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test; scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
115115
./project/scripts/cmdTests
116116
./project/scripts/bootstrappedOnlyCmdTests
117117
@@ -447,7 +447,7 @@ jobs:
447447

448448
- name: Test
449449
run: |
450-
./project/scripts/sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-test/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
450+
./project/scripts/sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-test/scripted scala2-compat/* ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
451451
./project/scripts/cmdTests
452452
./project/scripts/bootstrappedOnlyCmdTests
453453

.gitignore

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,6 @@ node_modules
3030
.metals/
3131
metals.sbt
3232

33-
# Scala-IDE specific
34-
.scala_dependencies
35-
.cache
36-
.cache-main
37-
.cache-tests
38-
.classpath
39-
.project
40-
.settings
41-
classes/
42-
*/bin/
43-
44-
# Dotty IDE
45-
/.dotty-ide-dev-port
46-
/.dotty-ide-artifact
47-
/.dotty-ide.json
48-
4933
# idea
5034
.idea
5135
.idea_modules
@@ -79,10 +63,6 @@ compiler/test/debug/Gen.jar
7963
compiler/before-pickling.txt
8064
compiler/after-pickling.txt
8165
bench/compile.txt
82-
*.dotty-ide-version
83-
84-
# The vscode app for testing
85-
vscode-dotty/.vscode-test
8666

8767
community-build/scala3-bootstrapped.version
8868
community-build/sbt-dotty-sbt

build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ val sjsJUnitTests = Build.sjsJUnitTests
3333
val sjsCompilerTests = Build.sjsCompilerTests
3434

3535
val `sbt-test` = Build.`sbt-test`
36-
val `vscode-dotty` = Build.`vscode-dotty`
3736

3837
inThisBuild(Build.thisBuildSettings)
3938
inScope(Global)(Build.globalSettings)

language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class DottyLanguageServer extends LanguageServer
5454
import lsp4j.jsonrpc.messages.{Either => JEither}
5555
import lsp4j._
5656

57-
5857
private[this] var rootUri: String = _
5958

6059
private[this] var myClient: DottyClient = _
@@ -646,7 +645,7 @@ class DottyLanguageServer extends LanguageServer
646645
}
647646

648647
object DottyLanguageServer {
649-
/** Configuration file normally generated by the DottyIDEPlugin */
648+
650649
final val IDE_CONFIG_FILE = ".dotty-ide.json"
651650

652651
final val RENAME_OVERRIDDEN_QUESTION = "Do you want to rename the base member, or only this member?"

language-server/src/dotty/tools/languageserver/Main.scala

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ import org.eclipse.lsp4j.launch._
1313
import org.eclipse.lsp4j.jsonrpc.Launcher
1414

1515
/** Run the Dotty Language Server.
16-
*
17-
* This is designed to be started from an editor supporting the Language Server
18-
* Protocol, the easiest way to fetch and run this is to use `coursier`:
19-
*
20-
* coursier launch $artifact -M dotty.tools.languageserver.Main -- -stdio
21-
*
22-
* Where $artifact comes from the `.dotty-ide-artifact` file in the current project, this file
23-
* can be created by the DottyIDEPlugin by running `sbt configureIDE`.
24-
*
25-
* See vscode-dotty/ for an example integration of the Dotty Language Server into Visual Studio Code.
2616
*/
2717
object Main {
2818
def main(args: Array[String]): Unit = {
@@ -34,28 +24,6 @@ object Main {
3424
scala.Console.withOut(scala.Console.err) {
3525
startServer(serverIn, serverOut)
3626
}
37-
case "-client_command" :: clientCommand =>
38-
val serverSocket = new ServerSocket(0)
39-
Runtime.getRuntime().addShutdownHook(new Thread(
40-
new Runnable {
41-
def run: Unit = {
42-
serverSocket.close()
43-
}
44-
}));
45-
46-
println("Starting client: " + clientCommand)
47-
val clientPB = new java.lang.ProcessBuilder(clientCommand: _*)
48-
clientPB.environment.put("DLS_DEV_MODE", "1")
49-
50-
val pw = new PrintWriter("../.dotty-ide-dev-port")
51-
pw.write(serverSocket.getLocalPort.toString)
52-
pw.close()
53-
54-
clientPB.inheritIO().start()
55-
56-
val clientSocket = serverSocket.accept()
57-
58-
startServer(clientSocket.getInputStream, clientSocket.getOutputStream)
5927
case _ =>
6028
Console.err.println("Invalid arguments: expected \"-stdio\" or \"-client_command ...\"")
6129
System.exit(1)

project/Build.scala

Lines changed: 2 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import java.io.File
22
import java.nio.file._
33

4+
import Process._
45
import Modes._
56
import ScaladocGeneration._
67
import com.jsuereth.sbtpgp.PgpKeys
@@ -16,8 +17,6 @@ import xerial.sbt.pack.PackPlugin
1617
import xerial.sbt.pack.PackPlugin.autoImport._
1718
import xerial.sbt.Sonatype.autoImport._
1819
import com.typesafe.tools.mima.plugin.MimaPlugin.autoImport._
19-
import dotty.tools.sbtplugin.DottyIDEPlugin.{installCodeExtension, prepareCommand, runProcess}
20-
import dotty.tools.sbtplugin.DottyIDEPlugin.autoImport._
2120
import org.scalajs.sbtplugin.ScalaJSPlugin
2221
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
2322
import sbtbuildinfo.BuildInfoPlugin
@@ -52,10 +51,6 @@ object DottyJSPlugin extends AutoPlugin {
5251

5352
// Typecheck the Scala.js IR found on the classpath
5453
scalaJSLinkerConfig ~= (_.withCheckIR(true)),
55-
56-
// Exclude all these projects from `configureIDE/launchIDE` since they
57-
// take time to compile, print a bunch of warnings, and are rarely edited.
58-
excludeFromIDE := true
5954
)
6055
}
6156

@@ -154,9 +149,6 @@ object Build {
154149
// Compiles the documentation and static site
155150
val genDocs = inputKey[Unit]("run scaladoc to generate static documentation site")
156151

157-
// Only available in vscode-dotty
158-
val unpublish = taskKey[Unit]("Unpublish a package")
159-
160152
// Settings used to configure the test language server
161153
val ideTestsCompilerVersion = taskKey[String]("Compiler version to use in IDE tests")
162154
val ideTestsCompilerArguments = taskKey[Seq[String]]("Compiler arguments to use in IDE tests")
@@ -183,11 +175,6 @@ object Build {
183175

184176
(Compile / compile / javacOptions) ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),
185177

186-
// Override `runCode` from DottyIDEPlugin to use the language-server and
187-
// vscode extension from the source repository of dotty instead of a
188-
// published version.
189-
runCode := (`scala3-language-server` / run).toTask("").value,
190-
191178
// Avoid various sbt craziness involving classloaders and parallelism
192179
run / fork := true,
193180
Test / fork := true,
@@ -285,7 +272,6 @@ object Build {
285272
crossPaths := false,
286273
// Do not depend on the Scala library
287274
autoScalaLibrary := false,
288-
excludeFromIDE := true,
289275
disableDocSetting
290276
)
291277

@@ -315,7 +301,6 @@ object Build {
315301

316302
version := dottyNonBootstrappedVersion,
317303
scalaVersion := referenceVersion,
318-
excludeFromIDE := true,
319304

320305
disableDocSetting
321306
)
@@ -1033,23 +1018,6 @@ object Build {
10331018
// Work around https://github.com/eclipse/lsp4j/issues/295
10341019
dependencyOverrides += "org.eclipse.xtend" % "org.eclipse.xtend.lib" % "2.16.0",
10351020
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
1036-
1037-
run := Def.inputTaskDyn {
1038-
val inputArgs = spaceDelimited("<arg>").parsed
1039-
1040-
val mainClass = "dotty.tools.languageserver.Main"
1041-
val extensionPath = (`vscode-dotty` / baseDirectory).value.getAbsolutePath
1042-
1043-
val codeArgs =
1044-
s"--extensionDevelopmentPath=$extensionPath" +:
1045-
(if (inputArgs.isEmpty) List((baseDirectory.value / "..").getAbsolutePath) else inputArgs)
1046-
1047-
val clientCommand = prepareCommand(codeCommand.value ++ codeArgs)
1048-
1049-
val allArgs = "-client_command" +: clientCommand
1050-
1051-
runTask(Runtime, mainClass, allArgs: _*)
1052-
}.dependsOn((`vscode-dotty` / Compile / compile)).evaluated
10531021
).
10541022
settings(
10551023
ideTestsCompilerVersion := (`scala3-compiler` / version).value,
@@ -1456,60 +1424,6 @@ object Build {
14561424
).evaluated
14571425
)
14581426

1459-
lazy val `vscode-dotty` = project.in(file("vscode-dotty")).
1460-
settings(commonSettings).
1461-
settings(
1462-
version := "0.1.17-snapshot", // Keep in sync with package.json
1463-
autoScalaLibrary := false,
1464-
publishArtifact := false,
1465-
bspEnabled := false,
1466-
(Compile / resourceGenerators) += Def.task {
1467-
// Resources that will be copied when bootstrapping a new project
1468-
val buildSbtFile = baseDirectory.value / "out" / "build.sbt"
1469-
IO.write(buildSbtFile,
1470-
s"""scalaVersion := "$publishedDottyVersion"""")
1471-
val dottyPluginSbtFile = baseDirectory.value / "out" / "scala3-plugin.sbt"
1472-
IO.write(dottyPluginSbtFile,
1473-
s"""addSbtPlugin("$dottyOrganization" % "sbt-dotty" % "$sbtDottyVersion")""")
1474-
Seq(buildSbtFile, dottyPluginSbtFile)
1475-
},
1476-
Compile / compile := Def.task {
1477-
val workingDir = baseDirectory.value
1478-
val coursier = workingDir / "out" / "coursier"
1479-
val packageJson = workingDir / "package.json"
1480-
if (!coursier.exists || packageJson.lastModified > coursier.lastModified)
1481-
runProcess(Seq("npm", "install"), wait = true, directory = Some(workingDir))
1482-
val tsc = workingDir / "node_modules" / ".bin" / "tsc"
1483-
runProcess(Seq(tsc.getAbsolutePath, "--pretty", "--project", workingDir.getAbsolutePath), wait = true)
1484-
1485-
// vscode-dotty depends on scala-lang.scala for syntax highlighting,
1486-
// this is not automatically installed when starting the extension in development mode
1487-
// (--extensionDevelopmentPath=...)
1488-
installCodeExtension(codeCommand.value, "scala-lang.scala")
1489-
1490-
sbt.internal.inc.Analysis.Empty
1491-
}.dependsOn((Compile / managedResources)).value,
1492-
sbt.Keys.`package`:= {
1493-
runProcess(Seq("vsce", "package"), wait = true, directory = Some(baseDirectory.value))
1494-
1495-
baseDirectory.value / s"dotty-${version.value}.vsix"
1496-
},
1497-
unpublish := {
1498-
runProcess(Seq("vsce", "unpublish"), wait = true, directory = Some(baseDirectory.value))
1499-
},
1500-
publish := {
1501-
runProcess(Seq("vsce", "publish"), wait = true, directory = Some(baseDirectory.value))
1502-
},
1503-
run := Def.inputTask {
1504-
val inputArgs = spaceDelimited("<arg>").parsed
1505-
val codeArgs = if (inputArgs.isEmpty) List((baseDirectory.value / "..").getAbsolutePath) else inputArgs
1506-
val extensionPath = baseDirectory.value.getAbsolutePath
1507-
val processArgs = List(s"--extensionDevelopmentPath=$extensionPath") ++ codeArgs
1508-
1509-
runProcess(codeCommand.value ++ processArgs, wait = true)
1510-
}.dependsOn((Compile / compile)).evaluated
1511-
)
1512-
15131427
lazy val `sbt-community-build` = project.in(file("sbt-community-build")).
15141428
enablePlugins(SbtPlugin).
15151429
settings(commonSettings).
@@ -1902,4 +1816,4 @@ object ScaladocConfigs {
19021816
.add(ApiSubdirectory(true))
19031817
.withTargets(roots)
19041818
}
1905-
}
1819+
}

0 commit comments

Comments
 (0)