Skip to content

Commit 5e05d3f

Browse files
authored
Merge pull request #2750 from dotty-staging/vs-code-settings
Add VSCode settings for the dotty project
2 parents 18b69a5 + eda5730 commit 5e05d3f

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.vscode-template/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"editor.tabSize": 2,
4+
"editor.insertSpaces": true,
5+
6+
"files.trimTrailingWhitespace": true,
7+
8+
"search.exclude": {
9+
"**/*.class": true,
10+
"**/*.hasTasty": true,
11+
"**/target/": true,
12+
"scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/": true, // only allow scala-backend/src
13+
"scala2-library/src/[abcefimprs]*": true, // only allow scala-backend/src/library
14+
"scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/": true, // only allow scala-backend/src
15+
"scala-backend/src/[abefilmprs]*": true, // only allow scala-backend/src/compiler
16+
"scala-backend/src/scala/reflect/": true,
17+
"scala-backend/src/scala/tools/{ant,cmd,reflect,util}*": true,
18+
"scala-backend/src/scala/tools/nsc/*.scala": true,
19+
"scala-backend/src/scala/tools/nsc/[aijrstu]*": true // only allow scala-backend/src/scala/tools/nsc/backend
20+
}
21+
}

project/Build.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ object Build {
262262
settings(commonNonBootstrappedSettings).
263263
settings(
264264
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
265-
submoduleChecks,
265+
dottyProjectFolderChecks,
266266

267267
addCommandAlias("run", "dotty-compiler/run") ++
268268
addCommandAlias("legacyTests", "dotty-compiler/testOnly dotc.tests")
@@ -1115,7 +1115,7 @@ object Build {
11151115
))
11161116
}
11171117

1118-
lazy val submoduleChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
1118+
lazy val dottyProjectFolderChecks = onLoad in Global := (onLoad in Global).value andThen { state =>
11191119
val submodules = List(new File("scala-backend"), new File("scala2-library"), new File("collection-strawman"))
11201120
if (!submodules.forall(f => f.exists && f.listFiles().nonEmpty)) {
11211121
sLog.value.log(Level.Error,
@@ -1124,6 +1124,10 @@ object Build {
11241124
| > git submodule update --init
11251125
""".stripMargin)
11261126
}
1127+
1128+
// Copy default configuration from .vscode-template/ unless configuration files already exist in .vscode/
1129+
sbt.IO.copyDirectory(new File(".vscode-template/"), new File(".vscode/"), overwrite = false)
1130+
11271131
state
11281132
}
11291133

0 commit comments

Comments
 (0)