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

Change displayBuildTarget to listBuildTargets #3649

Merged
merged 1 commit into from
Feb 21, 2022
Merged
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ class MetalsLanguageServer(
private val packageProvider: PackageProvider =
new PackageProvider(buildTargets)
private var newFileProvider: NewFileProvider = _
private var buildTargetProvider: BuildTargetProvider = _
private var debugProvider: DebugProvider = _
private var symbolSearch: MetalsSymbolSearch = _
private var compilers: Compilers = _
Expand Down Expand Up @@ -707,10 +706,6 @@ class MetalsLanguageServer(
diagnostics,
languageClient
)
buildTargetProvider = new BuildTargetProvider(
buildTargets,
languageClient
)
doctor = new Doctor(
workspace,
buildTargets,
Expand Down Expand Up @@ -1720,21 +1715,13 @@ class MetalsLanguageServer(
Future {
doctor.executeRunDoctor()
}.asJavaObject
case ServerCommands.TargetInfoDisplay() => {
Option(params.getArguments())
.map(_.asScala.toList)
.getOrElse(List.empty)
.headOption match {
case Some(arg: JsonPrimitive) =>
buildTargetProvider
.displayBuildTargetInfo(workspace, arg.getAsString)
.asJavaObject
case _ =>
buildTargetProvider
.askForBuildTargetAndDisplayBuildTargetInfo(workspace)
.asJavaObject
}
}
case ServerCommands.ListBuildTargets() =>
Future {
buildTargets.all.toList
.map(_.getDisplayName())
.sorted
.asJava
}.asJavaObject
case ServerCommands.BspSwitch() =>
(for {
isSwitched <- bspConnector.switchBuildServer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ object ServerCommands {
|""".stripMargin
)

val TargetInfoDisplay = new Command(
"target-info-display",
"Display target info",
"""|Choose a Build Target and view information about its configuration.
|""".stripMargin,
"""|[string], name of the Build Target.
val ListBuildTargets = new Command(
"list-build-targets",
"List build targets",
"""|Retrieve a list of build targets for the workspace.
|""".stripMargin
)

Expand Down Expand Up @@ -544,7 +542,7 @@ object ServerCommands {
RunDoctor,
DecodeFile,
DisconnectBuildServer,
TargetInfoDisplay,
ListBuildTargets,
ScanWorkspaceSources,
StartAmmoniteBuildServer,
StartDebugAdapter,
Expand Down