@@ -15,6 +15,7 @@ import sbt.Package.ManifestAttributes
15
15
import com .typesafe .sbteclipse .plugin .EclipsePlugin ._
16
16
17
17
import dotty .tools .sbtplugin .DottyPlugin .autoImport ._
18
+ import dotty .tools .sbtplugin .DottyIDEPlugin .runProcess
18
19
import dotty .tools .sbtplugin .DottyIDEPlugin .autoImport ._
19
20
import org .scalajs .sbtplugin .ScalaJSPlugin
20
21
import org .scalajs .sbtplugin .ScalaJSPlugin .autoImport ._
@@ -766,8 +767,13 @@ object Build {
766
767
val mainClass = " dotty.tools.languageserver.Main"
767
768
val extensionPath = (baseDirectory in `vscode-dotty`).value.getAbsolutePath
768
769
769
- val codeArgs = if (inputArgs.isEmpty) List ((baseDirectory.value / " .." ).getAbsolutePath) else inputArgs
770
- val allArgs = List (" -client_command" , " code" , s " --extensionDevelopmentPath= $extensionPath" ) ++ codeArgs
770
+ val codeArgs =
771
+ s " --extensionDevelopmentPath= $extensionPath" +:
772
+ (if (inputArgs.isEmpty) List ((baseDirectory.value / " .." ).getAbsolutePath) else inputArgs)
773
+
774
+ val clientCommand = codeCommand.value ++ codeArgs
775
+
776
+ val allArgs = " -client_command" +: clientCommand
771
777
772
778
runTask(Runtime , mainClass, allArgs : _* )
773
779
}.dependsOn(compile in (`vscode-dotty`, Compile )).evaluated
@@ -893,7 +899,7 @@ object Build {
893
899
894
900
895
901
sbtPlugin := true ,
896
- version := " 0.1.2 " ,
902
+ version := " 0.1.3-SNAPSHOT " ,
897
903
ScriptedPlugin .scriptedSettings,
898
904
ScriptedPlugin .sbtTestDirectory := baseDirectory.value / " sbt-test" ,
899
905
ScriptedPlugin .scriptedBufferLog := false ,
@@ -944,12 +950,7 @@ object Build {
944
950
// Currently, vscode-dotty depends on daltonjorge.scala for syntax highlighting,
945
951
// this is not automatically installed when starting the extension in development mode
946
952
// (--extensionDevelopmentPath=...)
947
- val exitCodeInstall = new java.lang.ProcessBuilder (" code" , " --install-extension" , " daltonjorge.scala" )
948
- .inheritIO()
949
- .start()
950
- .waitFor()
951
- if (exitCodeInstall != 0 )
952
- throw new MessageOnlyException (" Installing dependency daltonjorge.scala failed" )
953
+ runProcess(codeCommand.value ++ Seq (" --install-extension" , " daltonjorge.scala" ), wait = true )
953
954
954
955
sbt.inc.Analysis .Empty
955
956
},
@@ -986,14 +987,9 @@ object Build {
986
987
val inputArgs = spaceDelimited(" <arg>" ).parsed
987
988
val codeArgs = if (inputArgs.isEmpty) List ((baseDirectory.value / " .." ).getAbsolutePath) else inputArgs
988
989
val extensionPath = baseDirectory.value.getAbsolutePath
989
- val processArgs = List (" code " , s " --extensionDevelopmentPath= ${extensionPath}" ) ++ codeArgs
990
+ val processArgs = List (s " --extensionDevelopmentPath= ${extensionPath}" ) ++ codeArgs
990
991
991
- val exitCode = new java.lang.ProcessBuilder (processArgs : _* )
992
- .inheritIO()
993
- .start()
994
- .waitFor()
995
- if (exitCode != 0 )
996
- throw new MessageOnlyException (" Running Visual Studio Code failed" )
992
+ runProcess(codeCommand.value ++ processArgs, wait = true )
997
993
}.dependsOn(compile in Compile ).evaluated
998
994
)
999
995
0 commit comments