From 227a1021de716a709e075312a2f5a2efecc6df12 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 14 Jun 2017 10:15:50 +0200 Subject: [PATCH 01/11] Add VSCode settings for the dotty project --- .gitignore | 3 --- .vscode/settings.json | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index c84d75358520..b554f1453581 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,6 @@ project/local-plugins.sbt # npm node_modules -# VS Code -.vscode/ - # Scala-IDE specific .scala_dependencies .cache diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000000..ac1307ee109c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "editor.tabSize": 2, + "editor.insertSpaces": true, + + "search.exclude": { + "**/*.class": true, + "**/*.hasTasty": true + } +} From bd84d36ac4694941e75a33d9f24a37d7ac837c10 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 14 Jun 2017 12:42:11 +0200 Subject: [PATCH 02/11] Remove Trailing whitespaces --- .vscode/settings.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index ac1307ee109c..31630206e391 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,8 @@ "editor.tabSize": 2, "editor.insertSpaces": true, + "files.trimTrailingWhitespace": true, + "search.exclude": { "**/*.class": true, "**/*.hasTasty": true From 151d6b137b3aa62cc701212f5cb7b5d91c0a2f53 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 15 Jun 2017 10:35:34 +0200 Subject: [PATCH 03/11] Make template for .vscode/settings.json --- .gitignore | 3 +++ .vscode/{settings.json => settings-template.json} | 0 project/Build.scala | 11 +++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) rename .vscode/{settings.json => settings-template.json} (100%) diff --git a/.gitignore b/.gitignore index b554f1453581..c84d75358520 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ project/local-plugins.sbt # npm node_modules +# VS Code +.vscode/ + # Scala-IDE specific .scala_dependencies .cache diff --git a/.vscode/settings.json b/.vscode/settings-template.json similarity index 100% rename from .vscode/settings.json rename to .vscode/settings-template.json diff --git a/project/Build.scala b/project/Build.scala index c1858f385687..922a79db375f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -250,7 +250,7 @@ object Build { settings(commonNonBootstrappedSettings). settings( triggeredMessage in ThisBuild := Watched.clearWhenTriggered, - submoduleChecks, + dottyProjectFolderChecks, addCommandAlias("run", "dotty-compiler/run") ++ addCommandAlias("legacyTests", "dotty-compiler/testOnly dotc.tests") @@ -1138,7 +1138,7 @@ object Build { )) } - lazy val submoduleChecks = onLoad in Global := (onLoad in Global).value andThen { state => + lazy val dottyProjectFolderChecks = onLoad in Global := (onLoad in Global).value andThen { state => val submodules = List(new File("scala-backend"), new File("scala2-library"), new File("collection-strawman")) if (!submodules.forall(f => f.exists && f.listFiles().nonEmpty)) { sLog.value.log(Level.Error, @@ -1147,6 +1147,13 @@ object Build { | > git submodule update --init """.stripMargin) } + + val vscodeSetting = new File(".vscode/settings.json") + if(!vscodeSetting.exists()) { + val vscodeSettingTemplate = new File(".vscode/settings-template.json") + java.nio.file.Files.copy(vscodeSettingTemplate.toPath, vscodeSetting.toPath) + } + state } From 351b10c507a8f32d8357415da5fdc35f687e4b8d Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 15 Jun 2017 11:23:53 +0200 Subject: [PATCH 04/11] vscode exclude files in scala2-library and scala-backend --- .vscode/settings-template.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.vscode/settings-template.json b/.vscode/settings-template.json index 31630206e391..8d0f664284f0 100644 --- a/.vscode/settings-template.json +++ b/.vscode/settings-template.json @@ -7,6 +7,14 @@ "search.exclude": { "**/*.class": true, - "**/*.hasTasty": true + "**/*.hasTasty": true, + "scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/**": true, // only allow scala-backend/src + "scala2-library/src/[abcefimprs]**": true, // only allow scala-backend/src/library + "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/**": true, // only allow scala-backend/src + "scala-backend/src/[abefilmprs]**": true, // only allow scala-backend/src/compiler + "scala-backend/src/scala/reflec/**": true, + "scala-backend/src/scala/tools/{ant,cmd,reflect,util}**": true, + "scala-backend/src/scala/tools/nsc/*.scala": true, + "scala-backend/src/scala/tools/nsc/[aijrstu]**": true // only allow scala-backend/src/scala/tools/nsc/backend } } From 37b18f5e4209fad0429319c01fa6d59b6fcd2df2 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 15 Jun 2017 11:37:04 +0200 Subject: [PATCH 05/11] Fix typo --- .vscode/settings-template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings-template.json b/.vscode/settings-template.json index 8d0f664284f0..0b16a3bb7d64 100644 --- a/.vscode/settings-template.json +++ b/.vscode/settings-template.json @@ -12,7 +12,7 @@ "scala2-library/src/[abcefimprs]**": true, // only allow scala-backend/src/library "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/**": true, // only allow scala-backend/src "scala-backend/src/[abefilmprs]**": true, // only allow scala-backend/src/compiler - "scala-backend/src/scala/reflec/**": true, + "scala-backend/src/scala/reflect/**": true, "scala-backend/src/scala/tools/{ant,cmd,reflect,util}**": true, "scala-backend/src/scala/tools/nsc/*.scala": true, "scala-backend/src/scala/tools/nsc/[aijrstu]**": true // only allow scala-backend/src/scala/tools/nsc/backend From 1e479beb3089b784b51c80aabf302a927774d63e Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Thu, 15 Jun 2017 15:59:17 +0200 Subject: [PATCH 06/11] Move vs code template to .vscode-template/ --- .../settings.json | 0 project/Build.scala | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) rename .vscode/settings-template.json => .vscode-template/settings.json (100%) diff --git a/.vscode/settings-template.json b/.vscode-template/settings.json similarity index 100% rename from .vscode/settings-template.json rename to .vscode-template/settings.json diff --git a/project/Build.scala b/project/Build.scala index 922a79db375f..a02458186ea5 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1148,10 +1148,12 @@ object Build { """.stripMargin) } - val vscodeSetting = new File(".vscode/settings.json") + // If .vscode does not exist yet, initialize it with the contents of .vscode-template/ + val vscodeSetting = new File(".vscode/") if(!vscodeSetting.exists()) { - val vscodeSettingTemplate = new File(".vscode/settings-template.json") - java.nio.file.Files.copy(vscodeSettingTemplate.toPath, vscodeSetting.toPath) + vscodeSetting.mkdir() + for (file <- new File(".vscode-template/").listFiles) + java.nio.file.Files.copy(file.toPath, new File(vscodeSetting.getPath() + '/' + file.getName).toPath) } state From cd2dbf3a6c3bb2c5b24bd1bf74ffaa2e03b0551b Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 19 Jun 2017 12:05:04 +0200 Subject: [PATCH 07/11] Add missing space --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index a02458186ea5..2e2d9823e492 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1150,7 +1150,7 @@ object Build { // If .vscode does not exist yet, initialize it with the contents of .vscode-template/ val vscodeSetting = new File(".vscode/") - if(!vscodeSetting.exists()) { + if (!vscodeSetting.exists()) { vscodeSetting.mkdir() for (file <- new File(".vscode-template/").listFiles) java.nio.file.Files.copy(file.toPath, new File(vscodeSetting.getPath() + '/' + file.getName).toPath) From 1f4fb2b37ebb8a9986837c1701c16490a27b9d04 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 19 Jun 2017 12:05:42 +0200 Subject: [PATCH 08/11] Fix issue with ** --- .vscode-template/settings.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.vscode-template/settings.json b/.vscode-template/settings.json index 0b16a3bb7d64..f97b27af94cd 100644 --- a/.vscode-template/settings.json +++ b/.vscode-template/settings.json @@ -8,13 +8,13 @@ "search.exclude": { "**/*.class": true, "**/*.hasTasty": true, - "scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/**": true, // only allow scala-backend/src - "scala2-library/src/[abcefimprs]**": true, // only allow scala-backend/src/library - "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/**": true, // only allow scala-backend/src - "scala-backend/src/[abefilmprs]**": true, // only allow scala-backend/src/compiler - "scala-backend/src/scala/reflect/**": true, - "scala-backend/src/scala/tools/{ant,cmd,reflect,util}**": true, + "scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/*": true, // only allow scala-backend/src + "scala2-library/src/[abcefimprs]*": true, // only allow scala-backend/src/library + "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/*": true, // only allow scala-backend/src + "scala-backend/src/[abefilmprs]*": true, // only allow scala-backend/src/compiler + "scala-backend/src/scala/reflect/*": true, + "scala-backend/src/scala/tools/{ant,cmd,reflect,util}*": true, "scala-backend/src/scala/tools/nsc/*.scala": true, - "scala-backend/src/scala/tools/nsc/[aijrstu]**": true // only allow scala-backend/src/scala/tools/nsc/backend + "scala-backend/src/scala/tools/nsc/[aijrstu]*": true // only allow scala-backend/src/scala/tools/nsc/backend } } From 1fdb0e6b5d3221d8368fa9bdeb0dcbc3f558e25b Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 19 Jun 2017 12:07:14 +0200 Subject: [PATCH 09/11] Exclude files in target --- .vscode-template/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscode-template/settings.json b/.vscode-template/settings.json index f97b27af94cd..75420fb8f9c2 100644 --- a/.vscode-template/settings.json +++ b/.vscode-template/settings.json @@ -8,6 +8,7 @@ "search.exclude": { "**/*.class": true, "**/*.hasTasty": true, + "**/target/**": true, "scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/*": true, // only allow scala-backend/src "scala2-library/src/[abcefimprs]*": true, // only allow scala-backend/src/library "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/*": true, // only allow scala-backend/src From caa6186884b86b4a739b478f94c86389aa34c86a Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 19 Jun 2017 16:43:41 +0200 Subject: [PATCH 10/11] Use sbt.IO.copyDirectory --- project/Build.scala | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 2e2d9823e492..09d21c0aac74 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1148,13 +1148,8 @@ object Build { """.stripMargin) } - // If .vscode does not exist yet, initialize it with the contents of .vscode-template/ - val vscodeSetting = new File(".vscode/") - if (!vscodeSetting.exists()) { - vscodeSetting.mkdir() - for (file <- new File(".vscode-template/").listFiles) - java.nio.file.Files.copy(file.toPath, new File(vscodeSetting.getPath() + '/' + file.getName).toPath) - } + // If contents .vscode do not exist yet, initialize them with the contents of .vscode-template/ + sbt.IO.copyDirectory(new File(".vscode-template/"), new File(".vscode/"), overwrite = false) state } From eda5730251cdcfad14f8149ce30978b2af028a81 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 11 Jul 2017 13:02:55 +0200 Subject: [PATCH 11/11] Change regex ending with "/*" to end with "/" --- .vscode-template/settings.json | 8 ++++---- project/Build.scala | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vscode-template/settings.json b/.vscode-template/settings.json index 75420fb8f9c2..725c6df5ca48 100644 --- a/.vscode-template/settings.json +++ b/.vscode-template/settings.json @@ -8,12 +8,12 @@ "search.exclude": { "**/*.class": true, "**/*.hasTasty": true, - "**/target/**": true, - "scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/*": true, // only allow scala-backend/src + "**/target/": true, + "scala2-library/{doc,docs,lib,META-INF,scripts,spec,test,tools}/": true, // only allow scala-backend/src "scala2-library/src/[abcefimprs]*": true, // only allow scala-backend/src/library - "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/*": true, // only allow scala-backend/src + "scala-backend/{doc,docs,lib,META-INF,scripts,spec,test,tools}/": true, // only allow scala-backend/src "scala-backend/src/[abefilmprs]*": true, // only allow scala-backend/src/compiler - "scala-backend/src/scala/reflect/*": true, + "scala-backend/src/scala/reflect/": true, "scala-backend/src/scala/tools/{ant,cmd,reflect,util}*": true, "scala-backend/src/scala/tools/nsc/*.scala": true, "scala-backend/src/scala/tools/nsc/[aijrstu]*": true // only allow scala-backend/src/scala/tools/nsc/backend diff --git a/project/Build.scala b/project/Build.scala index 09d21c0aac74..4f0e75bd15ce 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1148,7 +1148,7 @@ object Build { """.stripMargin) } - // If contents .vscode do not exist yet, initialize them with the contents of .vscode-template/ + // Copy default configuration from .vscode-template/ unless configuration files already exist in .vscode/ sbt.IO.copyDirectory(new File(".vscode-template/"), new File(".vscode/"), overwrite = false) state