Skip to content

Commit 151d6b1

Browse files
committed
Make template for .vscode/settings.json
1 parent bd84d36 commit 151d6b1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ project/local-plugins.sbt
2222
# npm
2323
node_modules
2424

25+
# VS Code
26+
.vscode/
27+
2528
# Scala-IDE specific
2629
.scala_dependencies
2730
.cache
File renamed without changes.

project/Build.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ object Build {
250250
settings(commonNonBootstrappedSettings).
251251
settings(
252252
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
253-
submoduleChecks,
253+
dottyProjectFolderChecks,
254254

255255
addCommandAlias("run", "dotty-compiler/run") ++
256256
addCommandAlias("legacyTests", "dotty-compiler/testOnly dotc.tests")
@@ -1138,7 +1138,7 @@ object Build {
11381138
))
11391139
}
11401140

1141-
lazy val submoduleChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
1141+
lazy val dottyProjectFolderChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
11421142
val submodules = List(new File("scala-backend"), new File("scala2-library"), new File("collection-strawman"))
11431143
if (!submodules.forall(f => f.exists && f.listFiles().nonEmpty)) {
11441144
sLog.value.log(Level.Error,
@@ -1147,6 +1147,13 @@ object Build {
11471147
| > git submodule update --init
11481148
""".stripMargin)
11491149
}
1150+
1151+
val vscodeSetting = new File(".vscode/settings.json")
1152+
if(!vscodeSetting.exists()) {
1153+
val vscodeSettingTemplate = new File(".vscode/settings-template.json")
1154+
java.nio.file.Files.copy(vscodeSettingTemplate.toPath, vscodeSetting.toPath)
1155+
}
1156+
11501157
state
11511158
}
11521159

0 commit comments

Comments
 (0)