Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 419bbd7

Browse files
authored
Add Metals config options (#83)
1 parent 7bfc1d7 commit 419bbd7

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

src/main/scala/servers/Metals.scala

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object Metals extends ScalaLanguageServer { server =>
3838
}
3939

4040
override def javaExtraArgs(projectPath: String): Seq[String] =
41-
Config.metals.javaArgs.get.toSeq ++ Seq(
41+
Config.metals.`java-args`.get.toSeq ++ Seq(
4242
"-Dmetals.extensions=true",
4343
"-Dmetals.slow-task=status-bar",
4444
"-Dmetals.status-bar=on",
@@ -179,7 +179,19 @@ object MetalsConfig extends ConfigSchema {
179179
default = Metals.defaultVersion,
180180
)
181181

182-
val javaArgs = new Setting[js.Array[String]](
182+
val `scalafmt-config-path` = new Setting[String](
183+
title = "Scalafmt configuration",
184+
description = "Should be relative to the workspace root directory and use forward slashes `/` for file separators (even on Windows).",
185+
default = ".scalafmt.conf",
186+
)
187+
188+
val `java-home` = new Setting[String](
189+
title = "Java Home directory",
190+
description = "The Java Home directory used for indexing JDK sources and locating the `java` binary. Metals will try to detect this setting automatically, but you can override it here if you need more flexibility.",
191+
default = "",
192+
)
193+
194+
val `java-args` = new Setting[js.Array[String]](
183195
title = "Extra JVM options",
184196
default = js.Array(
185197
"-XX:+UseG1GC",
@@ -189,4 +201,28 @@ object MetalsConfig extends ConfigSchema {
189201
)
190202
)
191203

204+
val `sbt-script` = new Setting[String](
205+
title = "sbt script",
206+
description = "Optional absolute path to an `sbt` executable to use for running `sbt bloopInstall`. By default, Metals uses `java -jar sbt-launch.jar` with an embedded launcher while respecting `.jvmopts` and `.sbtopts`. Update this setting if your `sbt` script requires more customizations like using environment variables.",
207+
default = "",
208+
)
209+
210+
val `gradle-script` = new Setting[String](
211+
title = "gradle script",
212+
description = "Optional absolute path to a `gradle` executable to use for running `gradle bloopInstall`. By default, Metals uses gradlew with 5.3.1 gradle version. Update this setting if your `gradle` script requires more customizations like using environment variables.",
213+
default = "",
214+
)
215+
216+
val `maven-script` = new Setting[String](
217+
title = "maven script",
218+
description = "Optional absolute path to a `maven` executable to use for generating bloop config. By default, Metals uses `mvnw` maven wrapper with 3.6.1 maven version.. Update this setting if your `maven` script requires more customizations.",
219+
default = "",
220+
)
221+
222+
val `mill-script` = new Setting[String](
223+
title = "mill script",
224+
description = "Optional absolute path to a `mill` executable to use for running `mill mill.contrib.Bloop/install`. By default, Metals uses mill wrapper script with 0.4.0 mill version. Update this setting if your `mill` script requires more customizations like using environment variables.",
225+
default = "",
226+
)
227+
192228
}

0 commit comments

Comments
 (0)