From a1db631faa67ab2589d3f030cc8498e597d082aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 00:56:23 +0100 Subject: [PATCH 01/32] Update sbteclipse version --- project/project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index 21f94b2c..6c328d3c 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1,4 +1,4 @@ resolvers += Classpaths.typesafeSnapshots -addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0") +addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0") From 89562e8565fe0ff203011bfcf90ad359a03084c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 00:56:39 +0100 Subject: [PATCH 02/32] Update sbt version --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 748703f7..817bc38d 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.7 +sbt.version=0.13.9 From 3c53b585261c9f9191d19633318ed3f4179b374b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 01:00:15 +0100 Subject: [PATCH 03/32] Remove notes directory --- notes/scala-sync.txt | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 notes/scala-sync.txt diff --git a/notes/scala-sync.txt b/notes/scala-sync.txt deleted file mode 100644 index 30a3f4f0..00000000 --- a/notes/scala-sync.txt +++ /dev/null @@ -1,4 +0,0 @@ -scalac changes checked 26/April/2013 - -Scanners.scala: cdffcf8962c9fa606c027fcb5a50a4273976a576 -Parsers.scala: cd148d97225fc7738f7a8ff9d4479cd46d632371 From 1e6a2dca6f81d15c77c73cfaba4ef279402d6b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 12:14:44 +0100 Subject: [PATCH 04/32] Do not copy managed libs to project folder I do not think that we need the managed libs anywhere. --- project/Build.scala | 1 - project/plugins.sbt | 2 -- 2 files changed, 3 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 04e43a36..9589d4ca 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -32,7 +32,6 @@ object ScalariformBuild extends Build { "2.9.3", "2.9.2" //"2.9.1-1", "2.9.1", "2.9.0-1", "2.9.0" ), exportJars := true, // Needed for cli oneJar - retrieveManaged := true, scalacOptions += "-deprecation" ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 4fea78a7..97e3d973 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -11,5 +11,3 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.2.1") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0") - -retrieveManaged := true \ No newline at end of file From a27a496b511ad8a8cdad05cdbbedb9ec26a3182d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 12:39:42 +0100 Subject: [PATCH 05/32] Add scalac options to sbt build in order to make warnings explicit --- project/build.sbt | 1 + 1 file changed, 1 insertion(+) create mode 100644 project/build.sbt diff --git a/project/build.sbt b/project/build.sbt new file mode 100644 index 00000000..7c0c97c4 --- /dev/null +++ b/project/build.sbt @@ -0,0 +1 @@ +scalacOptions := Seq("-feature", "-deprecation", "-Xlint") From b5b5d37c6519483ce9c184c9a435ca58e890deaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 13:00:46 +0100 Subject: [PATCH 06/32] Fix several warnings in build files Default settings are deprecated and shouldn't be needed anyway. Also, it shouldn't be bad when the publish tasks are not overwritten to do nothing. --- project/Build.scala | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 9589d4ca..1406117f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -21,7 +21,7 @@ object ScalariformBuild extends Build { |Using 1.7 to build requires setting SBT to use JDK 1.7 or higher -- if SBT is |booting on JDK 1.6, you will get a javax.swing related compilation error.""".stripMargin - lazy val commonSettings = Defaults.defaultSettings ++ SbtScalariform.defaultScalariformSettings ++ sonatypeSettings ++ Seq( + lazy val commonSettings = SbtScalariform.defaultScalariformSettings ++ sonatypeSettings ++ Seq( organization := "org.scalariform", profileName := "org.scalariform", version := "0.1.8", @@ -41,11 +41,7 @@ object ScalariformBuild extends Build { def getScalariformPreferences(dir: File) = PreferencesImporterExporter.loadPreferences((dir / ".." / "formatterPreferences.properties").getPath) - lazy val root: Project = Project("root", file("."), settings = commonSettings ++ Seq( - publish := (), - publishLocal := ()) - ) aggregate (scalariform, cli, misc) - + lazy val root: Project = Project("root", file("."), settings = commonSettings) aggregate (scalariform, cli, misc) implicit class Regex(sc: StringContext) { def r = new util.matching.Regex(sc.parts.mkString, sc.parts.tail.map(_ => "x"): _*) @@ -111,8 +107,6 @@ object ScalariformBuild extends Build { libraryDependencies ++= Seq( "commons-io" % "commons-io" % "1.4", "com.miglayout" % "miglayout" % "3.7.4"), - publish := (), - publishLocal := (), validateJavaVersion := { val specJavaVersion = sys.props("java.specification.version") val compatibleJavaVersion = specJavaVersion == "1.7" || specJavaVersion == "1.8" From 97c299c6ed4360b94016c7f901751a3c5a960842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 13:41:35 +0100 Subject: [PATCH 07/32] Remove ensime config file --- .ensime | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .ensime diff --git a/.ensime b/.ensime deleted file mode 100644 index da392ec6..00000000 --- a/.ensime +++ /dev/null @@ -1,11 +0,0 @@ -;; This config was generated using ensime-config-gen. Feel free to customize its contents manually. - -( - -:project-package "scalariform" - -:use-sbt t - -:formatting-prefs (:rewriteArrowSymbols t :alignParameters t :alignSingleLineCaseStatements t) - -) From 962ccc18cc343bde855cd7666d4c4aba705f1b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 13:47:43 +0100 Subject: [PATCH 08/32] Remove Eclipse project files --- cli/.classpath | 11 ----------- cli/.project | 12 ------------ misc/.classpath | 13 ------------- misc/.project | 12 ------------ scalariform/.classpath | 14 -------------- scalariform/.project | 12 ------------ 6 files changed, 74 deletions(-) delete mode 100644 cli/.classpath delete mode 100644 cli/.project delete mode 100644 misc/.classpath delete mode 100644 misc/.project delete mode 100644 scalariform/.classpath delete mode 100644 scalariform/.project diff --git a/cli/.classpath b/cli/.classpath deleted file mode 100644 index e92a111b..00000000 --- a/cli/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/cli/.project b/cli/.project deleted file mode 100644 index 65a61846..00000000 --- a/cli/.project +++ /dev/null @@ -1,12 +0,0 @@ - - cli - - - org.scala-ide.sdt.core.scalabuilder - - - - org.scala-ide.sdt.core.scalanature - org.eclipse.jdt.core.javanature - - \ No newline at end of file diff --git a/misc/.classpath b/misc/.classpath deleted file mode 100644 index c89ac363..00000000 --- a/misc/.classpath +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/misc/.project b/misc/.project deleted file mode 100644 index 9d74239d..00000000 --- a/misc/.project +++ /dev/null @@ -1,12 +0,0 @@ - - misc - - - org.scala-ide.sdt.core.scalabuilder - - - - org.scala-ide.sdt.core.scalanature - org.eclipse.jdt.core.javanature - - diff --git a/scalariform/.classpath b/scalariform/.classpath deleted file mode 100644 index 768b86e5..00000000 --- a/scalariform/.classpath +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/scalariform/.project b/scalariform/.project deleted file mode 100644 index 12416490..00000000 --- a/scalariform/.project +++ /dev/null @@ -1,12 +0,0 @@ - - scalariform - - - org.scala-ide.sdt.core.scalabuilder - - - - org.scala-ide.sdt.core.scalanature - org.eclipse.jdt.core.javanature - - From bcb37b5c7fe64ea17abab59f5fe1697710276cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 13:55:20 +0100 Subject: [PATCH 09/32] Add Eclipse project files to gitignore --- .gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b02ca0f2..2cbfbd42 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,10 @@ corpusscan/target/ corpusscan/lib_managed/ corpusscan/src_managed/ docs/build -.settings nohup.out .history .cache -.idea/ \ No newline at end of file +.idea/ +.settings +.classpath +.project From 3af0455f7cb059e14520639d42b9858ca37d82aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 13:56:58 +0100 Subject: [PATCH 10/32] Remove maven build and Eclipse update site As far as I know they are only used by scala-ide and scala-ide doesn't need them anymore, since it can use nightlies of scalariform nowadays. --- pom.xml | 169 -------------- scalariform.feature/.project | 17 -- scalariform.feature/build.properties | 1 - .../compile.scalariform.feature.xml | 6 - scalariform.feature/feature.xml | 55 ----- scalariform.feature/pom.xml | 15 -- scalariform.update/.project | 17 -- scalariform.update/index.html | 60 ----- scalariform.update/pom.xml | 15 -- scalariform.update/site.xml | 10 - scalariform.update/web/site.css | 12 - scalariform.update/web/site.xsl | 214 ------------------ scalariform/pom.xml | 30 --- 13 files changed, 621 deletions(-) delete mode 100644 pom.xml delete mode 100644 scalariform.feature/.project delete mode 100644 scalariform.feature/build.properties delete mode 100644 scalariform.feature/compile.scalariform.feature.xml delete mode 100644 scalariform.feature/feature.xml delete mode 100644 scalariform.feature/pom.xml delete mode 100644 scalariform.update/.project delete mode 100644 scalariform.update/index.html delete mode 100644 scalariform.update/pom.xml delete mode 100644 scalariform.update/site.xml delete mode 100644 scalariform.update/web/site.css delete mode 100644 scalariform.update/web/site.xsl delete mode 100644 scalariform/pom.xml diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 348928d1..00000000 --- a/pom.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - 4.0.0 - org.scalariform - scalariform.parent - 0.1.8-SNAPSHOT - pom - - - - scm:git://github.com/daniel-trinh/scalariform.git - https://github.com/daniel-trinh/scalariform - - - - 0.20.0 - 2.10.4 - UTF-8 - 3.0.4 - 2.11 - 1.0.2 - 2_10 - - - - ${maven.version} - - - - - scalariform - scalariform.feature - scalariform.update - - - - org.scala-lang - scala-library - ${scala.version} - - - - - - org.eclipse.tycho - tycho-maven-plugin - ${tycho.version} - true - - - org.eclipse.tycho - target-platform-configuration - ${tycho.version} - - p2 - consider - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - 1.1 - - - validate - - create - - - - - false - false - 7 - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho.version} - - '${version.suffix}-'yyyyMMddHHmm'-${buildNumber}' - true - - - - net.alchim31.maven - scala-maven-plugin - 3.1.5 - - - - add-source - compile - - - - - ${scala.version} - - -Xmx1024m - -Xss4m - - - - - - - - kepler - p2 - http://download.eclipse.org/releases/kepler - - - sonatype.release - Sonatype maven release repository - https://oss.sonatype.org/content/repositories/releases/ - false - - - sonatype.snapshot - Sonatype maven snapshot repository - https://oss.sonatype.org/content/repositories/snapshots - - daily - - - - - - scala-2.10.x - - 2_10 - - - - scala-2.11.x - - 2.11.1 - 2_11 - - - - org.scala-lang.modules - scala-xml_${scala.binary.version} - ${scala.xml.version} - - - - - scala-2.12.x - - 2.12.0-SNAPSHOT - 2_12 - - - - org.scala-lang.modules - scala-xml_${scala.binary.version} - ${scala.xml.version} - - - - - diff --git a/scalariform.feature/.project b/scalariform.feature/.project deleted file mode 100644 index 9a81553a..00000000 --- a/scalariform.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - scalariform.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/scalariform.feature/build.properties b/scalariform.feature/build.properties deleted file mode 100644 index 64f93a9f..00000000 --- a/scalariform.feature/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = feature.xml diff --git a/scalariform.feature/compile.scalariform.feature.xml b/scalariform.feature/compile.scalariform.feature.xml deleted file mode 100644 index fb3937a9..00000000 --- a/scalariform.feature/compile.scalariform.feature.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/scalariform.feature/feature.xml b/scalariform.feature/feature.xml deleted file mode 100644 index 8cde3aa3..00000000 --- a/scalariform.feature/feature.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Code formatter for Scala 2.8 - - - - The MIT License - -Copyright (c) 2010 Matthew D. Russell - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and -to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - - - - - - - - - - - - - - diff --git a/scalariform.feature/pom.xml b/scalariform.feature/pom.xml deleted file mode 100644 index fd731872..00000000 --- a/scalariform.feature/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - scalariform.feature - eclipse-feature - 0.1.8-SNAPSHOT - - scalariform.parent - org.scalariform - 0.1.8-SNAPSHOT - - - diff --git a/scalariform.update/.project b/scalariform.update/.project deleted file mode 100644 index 12f73daa..00000000 --- a/scalariform.update/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - scalariform.update - - - - - - org.eclipse.pde.UpdateSiteBuilder - - - - - - org.eclipse.pde.UpdateSiteNature - - diff --git a/scalariform.update/index.html b/scalariform.update/index.html deleted file mode 100644 index 025ebb6b..00000000 --- a/scalariform.update/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - -scalariform.update - - - - - - -
- - diff --git a/scalariform.update/pom.xml b/scalariform.update/pom.xml deleted file mode 100644 index b877b6c9..00000000 --- a/scalariform.update/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - scalariform.update - eclipse-update-site - 0.1.8-SNAPSHOT - - scalariform.parent - com.danieltrinh - 0.1.8-SNAPSHOT - - - diff --git a/scalariform.update/site.xml b/scalariform.update/site.xml deleted file mode 100644 index 348ef1d5..00000000 --- a/scalariform.update/site.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - Scalariform Update Site - - - - - - diff --git a/scalariform.update/web/site.css b/scalariform.update/web/site.css deleted file mode 100644 index 62c6f9ff..00000000 --- a/scalariform.update/web/site.css +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/scalariform.update/web/site.xsl b/scalariform.update/web/site.xsl deleted file mode 100644 index b4c04bbd..00000000 --- a/scalariform.update/web/site.xsl +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - scalariform.update - - - -

scalariform.update

-

- - - - - - - - - - - - - - - - dark-row - - - light-row - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dark-row - - - light-row - - - - - - - - - - - - - - - dark-row - - - light-row - - - - - - - - -
- - - -
- - - -
-
- ( - ) -
-
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - -
Operating Systems:
Windows Systems:
Languages:
Architecture:
-


- Uncategorized -
- - - -
-
- ( - ) -
-
- - - - -
-

-
- - - - - - - - - - - - - - - - - - - - - -
Operating Systems:
Windows Systems:
Languages:
Architecture:
-
- - - -
-
- ( - ) -
-
- - - - -
-

-
- - - - - - - - - - - - - - - - - - - - - -
Operating Systems:
Windows Systems:
Languages:
Architecture:
-
- - -
-
-
diff --git a/scalariform/pom.xml b/scalariform/pom.xml deleted file mode 100644 index 7dfb112b..00000000 --- a/scalariform/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - org.scalariform - scalariform - 0.1.8-SNAPSHOT - eclipse-plugin - - scalariform.parent - org.scalariform - 0.1.8-SNAPSHOT - - - - - - - org.eclipse.tycho - tycho-compiler-plugin - ${tycho.version} - - - **/*.scala - - - - - - From 46833a2da0193a05133161b6d11028d07bfa137d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 14:12:19 +0100 Subject: [PATCH 11/32] Move scalariform files to correct directory The package was different from the actual directory, which is allowed in Scala but shouldn't be used. --- .../scala/{com/danieltrinh => }/scalariform/ScalaVersions.scala | 0 .../{com/danieltrinh => }/scalariform/astselect/AstSelector.scala | 0 .../{com/danieltrinh => }/scalariform/formatter/Alignment.scala | 0 .../scalariform/formatter/AnnotationFormatter.scala | 0 .../scalariform/formatter/CaseClauseFormatter.scala | 0 .../danieltrinh => }/scalariform/formatter/CommentFormatter.scala | 0 .../danieltrinh => }/scalariform/formatter/ExprFormatter.scala | 0 .../danieltrinh => }/scalariform/formatter/FormatResult.scala | 0 .../scalariform/formatter/FormatterDirectiveParser.scala | 0 .../danieltrinh => }/scalariform/formatter/FormatterState.scala | 0 .../danieltrinh => }/scalariform/formatter/ScalaFormatter.scala | 0 .../scalariform/formatter/SpecificFormatter.scala | 0 .../scalariform/formatter/TemplateFormatter.scala | 0 .../danieltrinh => }/scalariform/formatter/TypeFormatter.scala | 0 .../danieltrinh => }/scalariform/formatter/XmlFormatter.scala | 0 .../formatter/preferences/IFormattingPreferences.scala | 0 .../scalariform/formatter/preferences/PreferenceDescriptor.scala | 0 .../formatter/preferences/PreferencesImporterExporter.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/CharConstants.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/Chars.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/HiddenToken.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/HiddenTokens.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/Keywords.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/LexerMode.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/LexerResult.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/ModeStack.scala | 0 .../danieltrinh => }/scalariform/lexer/NewlineInferencer.scala | 0 .../scalariform/lexer/RedundantSemicolonDetector.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/ScalaLexer.scala | 0 .../danieltrinh => }/scalariform/lexer/ScalaLexerException.scala | 0 .../danieltrinh => }/scalariform/lexer/ScalaLexerReader.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/ScalaOnlyLexer.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/TagState.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/Token.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/TokenType.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/Tokens.scala | 0 .../danieltrinh => }/scalariform/lexer/UnicodeEscapeReader.scala | 0 .../scalariform/lexer/WhitespaceAndCommentsGrouper.scala | 0 .../scala/{com/danieltrinh => }/scalariform/lexer/XmlLexer.scala | 0 .../scala/{com/danieltrinh => }/scalariform/parser/AstNodes.scala | 0 .../scalariform/parser/InferredSemicolonScalaParser.scala | 0 .../{com/danieltrinh => }/scalariform/parser/ScalaParser.scala | 0 .../scalariform/parser/ScalaParserException.scala | 0 .../{com/danieltrinh => }/scalariform/utils/BooleanLang.scala | 0 .../danieltrinh => }/scalariform/utils/CaseClassReflector.scala | 0 .../scala/{com/danieltrinh => }/scalariform/utils/Range.scala | 0 .../scala/{com/danieltrinh => }/scalariform/utils/TextEdits.scala | 0 .../scala/{com/danieltrinh => }/scalariform/utils/Trimmed.scala | 0 .../scala/{com/danieltrinh => }/scalariform/utils/Utils.scala | 0 .../danieltrinh => }/scalariform/astselect/AstSelectorTest.scala | 0 .../scalariform/formatter/AbstractExpressionFormatterTest.scala | 0 .../scalariform/formatter/AbstractFormatterTest.scala | 0 .../scalariform/formatter/BlockExprFormatterTest.scala | 0 .../scalariform/formatter/CaseClausesFormatterTest.scala | 0 .../scalariform/formatter/CommentFormatterTest.scala | 0 .../scalariform/formatter/CompactControlReadabilityTest.scala | 0 .../scalariform/formatter/DefOrDclFormatterTest.scala | 0 .../scalariform/formatter/ForExprFormatterTest.scala | 0 .../scalariform/formatter/FormatterDirectiveParserTest.scala | 0 .../scalariform/formatter/FunctionFormatterTest.scala | 0 .../scalariform/formatter/IfExprFormatterTest.scala | 0 .../scalariform/formatter/ImportFormatterTest.scala | 0 .../scalariform/formatter/IndentWithTabsTest.scala | 0 .../scalariform/formatter/MiscExpressionFormatterTest.scala | 0 .../scalariform/formatter/MiscFormatterTest.scala | 0 .../scalariform/formatter/PackageFormatterTest.scala | 0 .../scalariform/formatter/ParenAndBracketSpacingTest.scala | 0 .../scalariform/formatter/RewriteArrowsTest.scala | 0 .../scalariform/formatter/ScriptFormatterTest.scala | 0 .../scalariform/formatter/StringInterpolationFormatterTest.scala | 0 .../scalariform/formatter/TemplateFormatterTest.scala | 0 .../scalariform/formatter/TryExprFormatterTest.scala | 0 .../scalariform/formatter/TypeFormatterTest.scala | 0 .../scalariform/formatter/WhileExprFormatterTest.scala | 0 .../scalariform/formatter/XmlExpressionFormatterTest.scala | 0 .../scalariform/lexer/NewlineInferencerTest.scala | 0 .../scalariform/lexer/RedundantSemicolonDetectorTest.scala | 0 .../{com/danieltrinh => }/scalariform/lexer/ScalaLexerTest.scala | 0 .../{com/danieltrinh => }/scalariform/parser/ParserTest.scala | 0 .../danieltrinh => }/scalariform/parser/ScalaParserTest.scala | 0 .../{com/danieltrinh => }/scalariform/utils/TextEditTest.scala | 0 .../{com/danieltrinh => }/scalariform/utils/TrimmedTest.scala | 0 82 files changed, 0 insertions(+), 0 deletions(-) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/ScalaVersions.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/astselect/AstSelector.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/Alignment.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/AnnotationFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/CaseClauseFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/CommentFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/ExprFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/FormatResult.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/FormatterDirectiveParser.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/FormatterState.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/ScalaFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/SpecificFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/TemplateFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/TypeFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/XmlFormatter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/preferences/IFormattingPreferences.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/preferences/PreferenceDescriptor.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/formatter/preferences/PreferencesImporterExporter.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/CharConstants.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/Chars.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/HiddenToken.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/HiddenTokens.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/Keywords.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/LexerMode.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/LexerResult.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/ModeStack.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/NewlineInferencer.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/RedundantSemicolonDetector.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/ScalaLexer.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/ScalaLexerException.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/ScalaLexerReader.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/ScalaOnlyLexer.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/TagState.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/Token.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/TokenType.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/Tokens.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/UnicodeEscapeReader.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/WhitespaceAndCommentsGrouper.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/lexer/XmlLexer.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/parser/AstNodes.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/parser/InferredSemicolonScalaParser.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/parser/ScalaParser.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/parser/ScalaParserException.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/utils/BooleanLang.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/utils/CaseClassReflector.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/utils/Range.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/utils/TextEdits.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/utils/Trimmed.scala (100%) rename scalariform/src/main/scala/{com/danieltrinh => }/scalariform/utils/Utils.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/astselect/AstSelectorTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/AbstractExpressionFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/AbstractFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/BlockExprFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/CaseClausesFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/CommentFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/CompactControlReadabilityTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/DefOrDclFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/ForExprFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/FormatterDirectiveParserTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/FunctionFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/IfExprFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/ImportFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/IndentWithTabsTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/MiscExpressionFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/MiscFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/PackageFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/ParenAndBracketSpacingTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/RewriteArrowsTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/ScriptFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/StringInterpolationFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/TemplateFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/TryExprFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/TypeFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/WhileExprFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/formatter/XmlExpressionFormatterTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/lexer/NewlineInferencerTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/lexer/RedundantSemicolonDetectorTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/lexer/ScalaLexerTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/parser/ParserTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/parser/ScalaParserTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/utils/TextEditTest.scala (100%) rename scalariform/src/test/scala/{com/danieltrinh => }/scalariform/utils/TrimmedTest.scala (100%) diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/ScalaVersions.scala b/scalariform/src/main/scala/scalariform/ScalaVersions.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/ScalaVersions.scala rename to scalariform/src/main/scala/scalariform/ScalaVersions.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/astselect/AstSelector.scala b/scalariform/src/main/scala/scalariform/astselect/AstSelector.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/astselect/AstSelector.scala rename to scalariform/src/main/scala/scalariform/astselect/AstSelector.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/Alignment.scala b/scalariform/src/main/scala/scalariform/formatter/Alignment.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/Alignment.scala rename to scalariform/src/main/scala/scalariform/formatter/Alignment.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/AnnotationFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/AnnotationFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/CaseClauseFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/CaseClauseFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/CommentFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/CommentFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/CommentFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/CommentFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/ExprFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/ExprFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/FormatResult.scala b/scalariform/src/main/scala/scalariform/formatter/FormatResult.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/FormatResult.scala rename to scalariform/src/main/scala/scalariform/formatter/FormatResult.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/FormatterDirectiveParser.scala b/scalariform/src/main/scala/scalariform/formatter/FormatterDirectiveParser.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/FormatterDirectiveParser.scala rename to scalariform/src/main/scala/scalariform/formatter/FormatterDirectiveParser.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/FormatterState.scala b/scalariform/src/main/scala/scalariform/formatter/FormatterState.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/FormatterState.scala rename to scalariform/src/main/scala/scalariform/formatter/FormatterState.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/ScalaFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/ScalaFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/SpecificFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/SpecificFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/SpecificFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/SpecificFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/TemplateFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/TemplateFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/TypeFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/TypeFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/TypeFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/TypeFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/XmlFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/XmlFormatter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/XmlFormatter.scala rename to scalariform/src/main/scala/scalariform/formatter/XmlFormatter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/preferences/IFormattingPreferences.scala b/scalariform/src/main/scala/scalariform/formatter/preferences/IFormattingPreferences.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/preferences/IFormattingPreferences.scala rename to scalariform/src/main/scala/scalariform/formatter/preferences/IFormattingPreferences.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/preferences/PreferenceDescriptor.scala b/scalariform/src/main/scala/scalariform/formatter/preferences/PreferenceDescriptor.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/preferences/PreferenceDescriptor.scala rename to scalariform/src/main/scala/scalariform/formatter/preferences/PreferenceDescriptor.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/preferences/PreferencesImporterExporter.scala b/scalariform/src/main/scala/scalariform/formatter/preferences/PreferencesImporterExporter.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/formatter/preferences/PreferencesImporterExporter.scala rename to scalariform/src/main/scala/scalariform/formatter/preferences/PreferencesImporterExporter.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/CharConstants.scala b/scalariform/src/main/scala/scalariform/lexer/CharConstants.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/CharConstants.scala rename to scalariform/src/main/scala/scalariform/lexer/CharConstants.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Chars.scala b/scalariform/src/main/scala/scalariform/lexer/Chars.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Chars.scala rename to scalariform/src/main/scala/scalariform/lexer/Chars.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/HiddenToken.scala b/scalariform/src/main/scala/scalariform/lexer/HiddenToken.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/HiddenToken.scala rename to scalariform/src/main/scala/scalariform/lexer/HiddenToken.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/HiddenTokens.scala b/scalariform/src/main/scala/scalariform/lexer/HiddenTokens.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/HiddenTokens.scala rename to scalariform/src/main/scala/scalariform/lexer/HiddenTokens.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Keywords.scala b/scalariform/src/main/scala/scalariform/lexer/Keywords.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Keywords.scala rename to scalariform/src/main/scala/scalariform/lexer/Keywords.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/LexerMode.scala b/scalariform/src/main/scala/scalariform/lexer/LexerMode.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/LexerMode.scala rename to scalariform/src/main/scala/scalariform/lexer/LexerMode.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/LexerResult.scala b/scalariform/src/main/scala/scalariform/lexer/LexerResult.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/LexerResult.scala rename to scalariform/src/main/scala/scalariform/lexer/LexerResult.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ModeStack.scala b/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ModeStack.scala rename to scalariform/src/main/scala/scalariform/lexer/ModeStack.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/NewlineInferencer.scala b/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/NewlineInferencer.scala rename to scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/RedundantSemicolonDetector.scala b/scalariform/src/main/scala/scalariform/lexer/RedundantSemicolonDetector.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/RedundantSemicolonDetector.scala rename to scalariform/src/main/scala/scalariform/lexer/RedundantSemicolonDetector.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaLexer.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaLexer.scala rename to scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaLexerException.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaLexerException.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaLexerException.scala rename to scalariform/src/main/scala/scalariform/lexer/ScalaLexerException.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaLexerReader.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaLexerReader.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaLexerReader.scala rename to scalariform/src/main/scala/scalariform/lexer/ScalaLexerReader.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaOnlyLexer.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/ScalaOnlyLexer.scala rename to scalariform/src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/TagState.scala b/scalariform/src/main/scala/scalariform/lexer/TagState.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/TagState.scala rename to scalariform/src/main/scala/scalariform/lexer/TagState.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Token.scala b/scalariform/src/main/scala/scalariform/lexer/Token.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Token.scala rename to scalariform/src/main/scala/scalariform/lexer/Token.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/TokenType.scala b/scalariform/src/main/scala/scalariform/lexer/TokenType.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/TokenType.scala rename to scalariform/src/main/scala/scalariform/lexer/TokenType.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Tokens.scala b/scalariform/src/main/scala/scalariform/lexer/Tokens.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/Tokens.scala rename to scalariform/src/main/scala/scalariform/lexer/Tokens.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/UnicodeEscapeReader.scala b/scalariform/src/main/scala/scalariform/lexer/UnicodeEscapeReader.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/UnicodeEscapeReader.scala rename to scalariform/src/main/scala/scalariform/lexer/UnicodeEscapeReader.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/WhitespaceAndCommentsGrouper.scala b/scalariform/src/main/scala/scalariform/lexer/WhitespaceAndCommentsGrouper.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/WhitespaceAndCommentsGrouper.scala rename to scalariform/src/main/scala/scalariform/lexer/WhitespaceAndCommentsGrouper.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/XmlLexer.scala b/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/lexer/XmlLexer.scala rename to scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/parser/AstNodes.scala b/scalariform/src/main/scala/scalariform/parser/AstNodes.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/parser/AstNodes.scala rename to scalariform/src/main/scala/scalariform/parser/AstNodes.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/parser/InferredSemicolonScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/parser/InferredSemicolonScalaParser.scala rename to scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/parser/ScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/parser/ScalaParser.scala rename to scalariform/src/main/scala/scalariform/parser/ScalaParser.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/parser/ScalaParserException.scala b/scalariform/src/main/scala/scalariform/parser/ScalaParserException.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/parser/ScalaParserException.scala rename to scalariform/src/main/scala/scalariform/parser/ScalaParserException.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/utils/BooleanLang.scala b/scalariform/src/main/scala/scalariform/utils/BooleanLang.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/utils/BooleanLang.scala rename to scalariform/src/main/scala/scalariform/utils/BooleanLang.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/utils/CaseClassReflector.scala b/scalariform/src/main/scala/scalariform/utils/CaseClassReflector.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/utils/CaseClassReflector.scala rename to scalariform/src/main/scala/scalariform/utils/CaseClassReflector.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/utils/Range.scala b/scalariform/src/main/scala/scalariform/utils/Range.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/utils/Range.scala rename to scalariform/src/main/scala/scalariform/utils/Range.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/utils/TextEdits.scala b/scalariform/src/main/scala/scalariform/utils/TextEdits.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/utils/TextEdits.scala rename to scalariform/src/main/scala/scalariform/utils/TextEdits.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/utils/Trimmed.scala b/scalariform/src/main/scala/scalariform/utils/Trimmed.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/utils/Trimmed.scala rename to scalariform/src/main/scala/scalariform/utils/Trimmed.scala diff --git a/scalariform/src/main/scala/com/danieltrinh/scalariform/utils/Utils.scala b/scalariform/src/main/scala/scalariform/utils/Utils.scala similarity index 100% rename from scalariform/src/main/scala/com/danieltrinh/scalariform/utils/Utils.scala rename to scalariform/src/main/scala/scalariform/utils/Utils.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/astselect/AstSelectorTest.scala b/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/astselect/AstSelectorTest.scala rename to scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/AbstractExpressionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/AbstractExpressionFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/AbstractExpressionFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/AbstractExpressionFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/AbstractFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/AbstractFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/AbstractFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/AbstractFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/BlockExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/BlockExprFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/BlockExprFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/BlockExprFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/CaseClausesFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/CaseClausesFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/CaseClausesFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/CaseClausesFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/CommentFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/CommentFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/CommentFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/CommentFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/CompactControlReadabilityTest.scala b/scalariform/src/test/scala/scalariform/formatter/CompactControlReadabilityTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/CompactControlReadabilityTest.scala rename to scalariform/src/test/scala/scalariform/formatter/CompactControlReadabilityTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/DefOrDclFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/DefOrDclFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/DefOrDclFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/DefOrDclFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ForExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/ForExprFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ForExprFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/ForExprFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/FormatterDirectiveParserTest.scala b/scalariform/src/test/scala/scalariform/formatter/FormatterDirectiveParserTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/FormatterDirectiveParserTest.scala rename to scalariform/src/test/scala/scalariform/formatter/FormatterDirectiveParserTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/FunctionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/FunctionFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/FunctionFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/FunctionFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/IfExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/IfExprFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/IfExprFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/IfExprFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ImportFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/ImportFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ImportFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/ImportFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/IndentWithTabsTest.scala b/scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/IndentWithTabsTest.scala rename to scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MiscExpressionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/MiscExpressionFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MiscExpressionFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/MiscExpressionFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MiscFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/MiscFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/MiscFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/MiscFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/PackageFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/PackageFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/PackageFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/PackageFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ParenAndBracketSpacingTest.scala b/scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ParenAndBracketSpacingTest.scala rename to scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/RewriteArrowsTest.scala b/scalariform/src/test/scala/scalariform/formatter/RewriteArrowsTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/RewriteArrowsTest.scala rename to scalariform/src/test/scala/scalariform/formatter/RewriteArrowsTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ScriptFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/ScriptFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/ScriptFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/ScriptFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/StringInterpolationFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/StringInterpolationFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/TemplateFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/TemplateFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/TryExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/TryExprFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/TryExprFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/TryExprFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/TypeFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/TypeFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/TypeFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/TypeFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/WhileExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/WhileExprFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/WhileExprFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/WhileExprFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/XmlExpressionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/XmlExpressionFormatterTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/formatter/XmlExpressionFormatterTest.scala rename to scalariform/src/test/scala/scalariform/formatter/XmlExpressionFormatterTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/lexer/NewlineInferencerTest.scala b/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/lexer/NewlineInferencerTest.scala rename to scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/lexer/RedundantSemicolonDetectorTest.scala b/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/lexer/RedundantSemicolonDetectorTest.scala rename to scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/lexer/ScalaLexerTest.scala b/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/lexer/ScalaLexerTest.scala rename to scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/parser/ParserTest.scala b/scalariform/src/test/scala/scalariform/parser/ParserTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/parser/ParserTest.scala rename to scalariform/src/test/scala/scalariform/parser/ParserTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/parser/ScalaParserTest.scala b/scalariform/src/test/scala/scalariform/parser/ScalaParserTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/parser/ScalaParserTest.scala rename to scalariform/src/test/scala/scalariform/parser/ScalaParserTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/utils/TextEditTest.scala b/scalariform/src/test/scala/scalariform/utils/TextEditTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/utils/TextEditTest.scala rename to scalariform/src/test/scala/scalariform/utils/TextEditTest.scala diff --git a/scalariform/src/test/scala/com/danieltrinh/scalariform/utils/TrimmedTest.scala b/scalariform/src/test/scala/scalariform/utils/TrimmedTest.scala similarity index 100% rename from scalariform/src/test/scala/com/danieltrinh/scalariform/utils/TrimmedTest.scala rename to scalariform/src/test/scala/scalariform/utils/TrimmedTest.scala From 76e95541981bf4b3acb8c4f9b05a7f27f3feeac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 14:13:41 +0100 Subject: [PATCH 12/32] Use Scala 2.11.7 by default --- project/Build.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 1406117f..622a43f8 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -25,7 +25,7 @@ object ScalariformBuild extends Build { organization := "org.scalariform", profileName := "org.scalariform", version := "0.1.8", - scalaVersion := "2.10.6", + scalaVersion := "2.11.7", crossScalaVersions := Seq( "2.11.7", "2.10.6", From 62f9cbf6ede91a1a3a3e064b9a219fe6791529cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 14:56:37 +0100 Subject: [PATCH 13/32] Remove unnecessary resolver --- project/project/plugins.sbt | 3 --- 1 file changed, 3 deletions(-) diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index 6c328d3c..737941de 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1,4 +1 @@ -resolvers += Classpaths.typesafeSnapshots - addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0") - From 1098d892e6848beb60325715da274ee044ff0437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 15:32:14 +0100 Subject: [PATCH 14/32] Remove lots of unused code --- .../formatter/AnnotationFormatter.scala | 3 +- .../formatter/CaseClauseFormatter.scala | 4 +- .../scalariform/formatter/ExprFormatter.scala | 63 +++++++-------- .../formatter/ScalaFormatter.scala | 10 +-- .../formatter/SpecificFormatter.scala | 4 - .../formatter/TemplateFormatter.scala | 2 +- .../scalariform/formatter/XmlFormatter.scala | 11 ++- .../scala/scalariform/lexer/ModeStack.scala | 2 +- .../scalariform/lexer/NewlineInferencer.scala | 3 - .../scala/scalariform/lexer/ScalaLexer.scala | 6 +- .../scala/scalariform/lexer/XmlLexer.scala | 4 - .../parser/InferredSemicolonScalaParser.scala | 80 +++++++------------ .../scalariform/parser/ScalaParser.scala | 48 ++--------- .../utils/CaseClassReflector.scala | 9 --- 14 files changed, 75 insertions(+), 174 deletions(-) diff --git a/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala index d7a06a43..f762ef62 100644 --- a/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala @@ -8,7 +8,7 @@ import scalariform.formatter.preferences._ trait AnnotationFormatter { self: HasFormattingPreferences with TypeFormatter with ExprFormatter ⇒ def format(annotation: Annotation)(implicit formatterState: FormatterState): FormatResult = { - val Annotation(atToken: Token, annotationType: Type, argumentExprss: List[ArgumentExprs], newlineOption: Option[Token]) = annotation + val Annotation(_, annotationType, argumentExprss, newlineOption) = annotation var formatResult: FormatResult = NoFormatResult formatResult = formatResult.before(annotationType.firstToken, Compact) @@ -21,4 +21,3 @@ trait AnnotationFormatter { self: HasFormattingPreferences with TypeFormatter wi } } - diff --git a/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala index 473c74b9..074be2ef 100644 --- a/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala @@ -78,7 +78,7 @@ trait CaseClauseFormatter { self: HasFormattingPreferences with ExprFormatter wi val newlineBeforeClause = hiddenPredecessors(caseClause.firstToken).containsNewline || previousCaseClauseEndsWithNewline(caseClause, caseClausesAstNode) - // To evaluate whether a clause body is multiline, we ignore a trailing newline: + // To evaluate whether a clause body is multiline, we ignore a trailing newline: val clauseBodyIsMultiline = containsNewline(pruneTrailingNewline(statSeq)) || statSeq.firstTokenOption.exists(hiddenPredecessors(_).containsNewline) @@ -99,7 +99,7 @@ trait CaseClauseFormatter { self: HasFormattingPreferences with ExprFormatter wi } private def formatCasePattern(casePattern: CasePattern, arrowInstructionOpt: Option[PlaceAtColumn] = None)(implicit formatterState: FormatterState): FormatResult = { - val CasePattern(caseToken: Token, pattern: Expr, guardOption: Option[Guard], arrow: Token) = casePattern + val CasePattern(_, pattern: Expr, guardOption: Option[Guard], arrow: Token) = casePattern var formatResult: FormatResult = NoFormatResult formatResult ++= format(pattern) for (guard ← guardOption) diff --git a/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala index b8176793..6f2ac945 100755 --- a/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala @@ -47,7 +47,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def formatStringInterpolation(stringInterpolation: StringInterpolation)(implicit formatterState: FormatterState): FormatResult = { - val StringInterpolation(interpolationId, stringPartsAndScala, terminalString) = stringInterpolation + val StringInterpolation(_, stringPartsAndScala, terminalString) = stringInterpolation var formatResult: FormatResult = NoFormatResult formatResult = formatResult.before(terminalString, Compact) for ((stringPart, scala) ← stringPartsAndScala) { @@ -66,7 +66,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(ascriptionExpr: AscriptionExpr)(implicit formatterState: FormatterState): FormatResult = { - val AscriptionExpr(left: List[ExprElement], colon: Token, right: List[ExprElement]) = ascriptionExpr + val AscriptionExpr(left: List[ExprElement], _, right: List[ExprElement]) = ascriptionExpr var formatResult: FormatResult = NoFormatResult var currentFormatterState = formatterState val (leftFormatResult, updatedFormatterState) = formatExprElements(left) @@ -77,7 +77,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(equalsExpr: EqualsExpr)(implicit formatterState: FormatterState): FormatResult = { - val EqualsExpr(lhs: List[ExprElement], equals: Token, rhs: Expr) = equalsExpr + val EqualsExpr(lhs: List[ExprElement], _, rhs: Expr) = equalsExpr var formatResult: FormatResult = NoFormatResult var currentFormatterState = formatterState val (leftFormatResult, updatedFormatterState) = formatExprElements(lhs) @@ -92,7 +92,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(matchExpr: MatchExpr)(implicit formatterState: FormatterState): FormatResult = { - val MatchExpr(left: List[ExprElement], matchToken: Token, block: BlockExpr) = matchExpr + val MatchExpr(left: List[ExprElement], _, block: BlockExpr) = matchExpr var formatResult: FormatResult = NoFormatResult var currentFormatterState = formatterState val (leftFormatResult, updatedFormatterState) = formatExprElements(left) @@ -111,7 +111,6 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi for ((previousElementOption, element, nextElementOption) ← Utils.withPreviousAndNext(exprElements)) { previousElementOption match { case Some(previousElement) ⇒ - var nestedFormatterState = currentFormatterState val instructionOption = condOpt(previousElement, element) { case (PrefixExprElement(_), _) ⇒ if (Chars.isOperatorPart(element.firstToken.text(0))) CompactEnsuringGap else Compact case (Argument(_), _) ⇒ Compact @@ -275,7 +274,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } def format(anonymousFunction: AnonymousFunction)(implicit formatterState: FormatterState): FormatResult = { // <-- Also formatted specially in BlockExpr - val AnonymousFunction(parameters, arrow, body) = anonymousFunction + val AnonymousFunction(parameters, _, body) = anonymousFunction var formatResult: FormatResult = NoFormatResult formatResult ++= format(parameters) val bodyFirstTokenOpt = body.tokens.headOption @@ -329,7 +328,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi var formatResult: FormatResult = NoFormatResult var argumentFormatterState = formatterState - val ParenArgumentExprs(lparen, contents, rparen) = parenArguments + val ParenArgumentExprs(_, contents, _) = parenArguments /* Force a newline for the first argument if this is a set of * multi line arguments: @@ -426,7 +425,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(tryExpr: TryExpr)(implicit formatterState: FormatterState): FormatResult = { - val TryExpr(tryToken: Token, body: Expr, catchClauseOption: Option[CatchClause], finallyClauseOption: Option[(Token, Expr)]) = tryExpr + val TryExpr(_, body: Expr, catchClauseOption: Option[CatchClause], finallyClauseOption: Option[(Token, Expr)]) = tryExpr var formatResult: FormatResult = NoFormatResult // TODO: similar to first half of ifExpr, whileExpr etc @@ -501,7 +500,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(ifExpr: IfExpr)(implicit formatterState: FormatterState): FormatResult = { - val IfExpr(ifToken: Token, condExpr: CondExpr, newlinesOpt: Option[Token], body: Expr, elseClauseOption: Option[ElseClause]) = ifExpr + val IfExpr(_, condExpr: CondExpr, newlinesOpt: Option[Token], body: Expr, elseClauseOption: Option[ElseClause]) = ifExpr var formatResult: FormatResult = NoFormatResult // TODO: Same as first half of whileExpr @@ -559,7 +558,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(condExpr: CondExpr)(implicit formatterState: FormatterState): FormatResult = { - val CondExpr(lparen: Token, condition: Expr, rparen: Token) = condExpr + val CondExpr(_, condition: Expr, _) = condExpr format(condition) } @@ -567,8 +566,8 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi private def format(forExpr: ForExpr)(implicit formatterState: FormatterState): FormatResult = { val ForExpr( - forToken: Token, - lParenOrBrace: Token, + _, + _, enumerators: Enumerators, rParenOrBrace: Token, newlinesOpt: Option[Token], @@ -649,7 +648,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(generator: Generator)(implicit formatterState: FormatterState): FormatResult = { - val Generator(valOption: Option[Token], pattern: Expr, equalsOrArrowToken: Token, expr: Expr, guards: List[Guard]) = generator + val Generator(_, pattern: Expr, _, expr: Expr, guards: List[Guard]) = generator var formatResult: FormatResult = NoFormatResult formatResult ++= format(expr) formatResult ++= format(pattern) @@ -659,13 +658,13 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } def format(guard: Guard)(implicit formatterState: FormatterState): FormatResult = { - val Guard(ifToken: Token, expr: Expr) = guard + val Guard(_, expr: Expr) = guard format(expr) } private def format(whileExpr: WhileExpr)(implicit formatterState: FormatterState): FormatResult = { // TODO: Same as first half of ifExpr - val WhileExpr(whileToken: Token, condExpr: CondExpr, newlinesOpt: Option[Token], body: Expr) = whileExpr + val WhileExpr(_, condExpr: CondExpr, newlinesOpt: Option[Token], body: Expr) = whileExpr var formatResult: FormatResult = NoFormatResult formatResult ++= format(condExpr) @@ -695,7 +694,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi private def format(doExpr: DoExpr)(implicit formatterState: FormatterState): FormatResult = { var formatResult: FormatResult = NoFormatResult - val DoExpr(doToken: Token, body: Expr, statSepOpt: Option[Token], whileToken: Token, condExpr: CondExpr) = doExpr + val DoExpr(_, body: Expr, statSepOpt: Option[Token], whileToken: Token, condExpr: CondExpr) = doExpr val bodyIsABlock = isBlockExpr(body) val indentBody = !bodyIsABlock && hiddenPredecessors(body.firstToken).containsNewline @@ -740,7 +739,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi private def isBlockExpr(expr: Expr) = expr.contents.size == 1 && expr.contents(0).isInstanceOf[BlockExpr] def format(blockExpr: BlockExpr, indent: Boolean)(implicit formatterState: FormatterState): FormatResult = { - val BlockExpr(lbrace: Token, caseClausesOrStatSeq: Either[CaseClauses, StatSeq], rbrace: Token) = blockExpr + val BlockExpr(_, caseClausesOrStatSeq: Either[CaseClauses, StatSeq], rbrace: Token) = blockExpr var formatResult: FormatResult = NoFormatResult val singleLineBlock = !containsNewline(blockExpr) val newFormatterState = formatterState.copy(inSingleLineBlock = singleLineBlock) @@ -866,7 +865,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } def format(packageBlock: PackageBlock)(implicit formatterState: FormatterState): FormatResult = { - val PackageBlock(packageToken: Token, name: CallExpr, newlineOpt: Option[Token], lbrace: Token, topStats: StatSeq, rbrace: Token) = packageBlock + val PackageBlock(_, _, newlineOpt: Option[Token], lbrace: Token, topStats: StatSeq, rbrace: Token) = packageBlock var formatResult: FormatResult = NoFormatResult formatResult = newlineOpt match { @@ -881,11 +880,6 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi def format(fullDefOrDcl: FullDefOrDcl)(implicit formatterState: FormatterState): FormatResult = { val FullDefOrDcl(annotations: List[Annotation], modifiers: List[Modifier], defOrDcl: DefOrDcl) = fullDefOrDcl var formatResult: FormatResult = NoFormatResult - val preAnnotationFormattingInstruction = - if (formatterState.inSingleLineBlock) - CompactEnsuringGap - else - formatterState.currentIndentLevelInstruction for ((previousAnnotationOpt, annotation, nextAnnotationOpt) ← Utils.withPreviousAndNext(annotations)) { formatResult ++= format(annotation) for (previousAnnotation ← previousAnnotationOpt) { @@ -921,7 +915,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi private def format(patDefOrDcl: PatDefOrDcl)(implicit formatterState: FormatterState): FormatResult = { var formatResult: FormatResult = NoFormatResult - val PatDefOrDcl(valOrVarToken: Token, pattern: Expr, otherPatterns: List[(Token, Expr)], typedOpt: Option[(Token, Type)], equalsClauseOption: Option[(Token, Expr)]) = patDefOrDcl + val PatDefOrDcl(_, pattern: Expr, otherPatterns: List[(Token, Expr)], typedOpt: Option[(Token, Type)], equalsClauseOption: Option[(Token, Expr)]) = patDefOrDcl formatResult ++= format(pattern) for ((comma, otherPattern) ← otherPatterns) formatResult ++= format(otherPattern) @@ -946,8 +940,8 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi def format(funDefOrDcl: FunDefOrDcl)(implicit formatterState: FormatterState): FormatResult = { // TODO: Lots var formatResult: FormatResult = NoFormatResult - val FunDefOrDcl(defToken: Token, nameToken: Token, typeParamClauseOpt: Option[TypeParamClause], paramClauses: ParamClauses, - returnTypeOpt: Option[(Token, Type)], funBodyOpt: Option[FunBody], localDef: Boolean) = funDefOrDcl + val FunDefOrDcl(_, _, typeParamClauseOpt: Option[TypeParamClause], paramClauses: ParamClauses, + returnTypeOpt: Option[(Token, Type)], funBodyOpt: Option[FunBody], _) = funDefOrDcl for (typeParamClause ← typeParamClauseOpt) formatResult ++= format(typeParamClause.contents) formatResult ++= formatParamClauses(paramClauses) @@ -980,11 +974,11 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } def formatParamClauses(paramClauses: ParamClauses, doubleIndentParams: Boolean = false)(implicit formatterState: FormatterState): FormatResult = { - val ParamClauses(initialNewlineOpt, paramClausesAndNewlines) = paramClauses + val ParamClauses(_, paramClausesAndNewlines) = paramClauses var formatResult: FormatResult = NoFormatResult var currentFormatterState = formatterState for ((paramClause, newlineOption) ← paramClausesAndNewlines) { // TODO: Newlines. // maybe already done in some cases by format(tmplDef)? - val (paramClauseFormatResult, newFormatterState) = formatParamClause(paramClause, doubleIndentParams)(currentFormatterState) + val (paramClauseFormatResult, _) = formatParamClause(paramClause, doubleIndentParams)(currentFormatterState) formatResult ++= paramClauseFormatResult } formatResult @@ -992,7 +986,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi // TODO: Parts of this function might be useful in implementing other alignment features protected def calculateParamSectionLengths(param: Param, first: Boolean)(implicit formatterState: FormatterState): Option[ParamSectionLengths] = { - val Param(annotations, modifiers, valOrVarOpt, id, paramTypeOpt, defaultValueOpt) = param + val Param(annotations, modifiers, valOrVarOpt, id, paramTypeOpt, _) = param val formattedParam = formattedAstNode(param) { format(param)(formatterState) @@ -1142,8 +1136,8 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi paramsGroup } - private def formatParamClause(paramClause: ParamClause, doubleIndentParams: Boolean = false)(implicit formatterState: FormatterState): (FormatResult, FormatterState) = { - val ParamClause(lparen, implicitOption, firstParamOption, otherParams, rparen) = paramClause + private def formatParamClause(paramClause: ParamClause, doubleIndentParams: Boolean)(implicit formatterState: FormatterState): (FormatResult, FormatterState) = { + val ParamClause(_, implicitOption, firstParamOption, otherParams, rparen) = paramClause val paramIndent = if (doubleIndentParams) 2 else 1 val relativeToken = paramClause.tokens(1) // TODO var formatResult: FormatResult = NoFormatResult @@ -1299,7 +1293,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(param: Param)(implicit formatterState: FormatterState): FormatResult = { - val Param(annotations: List[Annotation], modifiers: List[Modifier], valOrVarOpt: Option[Token], id: Token, paramTypeOpt: Option[(Token, Type)], defaultValueOpt: Option[(Token, Expr)]) = param + val Param(annotations: List[Annotation], _, _, _, paramTypeOpt: Option[(Token, Type)], defaultValueOpt: Option[(Token, Expr)]) = param var formatResult: FormatResult = NoFormatResult for (annotation ← annotations) { @@ -1315,7 +1309,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } protected def format(import_ :ImportClause)(implicit formatterState: FormatterState): FormatResult = { - val ImportClause(importToken: Token, importExpr: ImportExpr, otherImportExprs: List[(Token, ImportExpr)]) = import_ + val ImportClause(_, importExpr: ImportExpr, otherImportExprs: List[(Token, ImportExpr)]) = import_ var formatResult: FormatResult = NoFormatResult formatResult ++= format(importExpr) for ((comma, otherImportExpr) ← otherImportExprs) @@ -1329,13 +1323,12 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } private def format(blockImportExpr: BlockImportExpr)(implicit formatterState: FormatterState): FormatResult = { - val BlockImportExpr(prefixExpr, importSelectors @ ImportSelectors(lbrace, firstImportSelector: Expr, otherImportSelectors: List[(Token, Expr)], rbrace)) = blockImportExpr + val BlockImportExpr(prefixExpr, importSelectors @ ImportSelectors(_, firstImportSelector: Expr, otherImportSelectors: List[(Token, Expr)], rbrace)) = blockImportExpr var formatResult: FormatResult = NoFormatResult formatResult ++= format(prefixExpr) val singleLineBlock = !containsNewline(importSelectors) - val newFormatterState = formatterState.copy(inSingleLineBlock = singleLineBlock) if (singleLineBlock) { // We are in a braced import statement like "import foo.{bar=>baz}" diff --git a/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala index 04a48d95..8851853a 100644 --- a/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala @@ -168,7 +168,6 @@ abstract class ScalaFormatter extends HasFormattingPreferences with TypeFormatte val startPos = builder.length val allWhitespace = hiddenTokens forall { _.isInstanceOf[Whitespace] } - var edits: List[TextEdit] = Nil instruction match { case Compact ⇒ writeIntertokenCompact() case CompactEnsuringGap ⇒ @@ -299,7 +298,6 @@ abstract class ScalaFormatter extends HasFormattingPreferences with TypeFormatte } def currentIndent = { - val current = currentColumn val lineStart = builder.length - currentColumn var pos = lineStart while (pos < builder.length && builder(pos).isWhitespace) @@ -446,19 +444,19 @@ object ScalaFormatter { OBJECT, OVERRIDE, PACKAGE, PRIVATE, PROTECTED, RETURN, SEALED, /* SUPER, THIS, */ THROW, TRAIT, TRY, /* TYPE ,*/ - VAL, VAR, WHILE, WITH, YIELD, + VAL, VAR, WHILE, WITH, YIELD, /* USCORE, */ COLON, EQUALS, ARROW, LARROW, RARROW, SUBTYPE, VIEWBOUND, SUPERTYPE, /* HASH, AT */ LBRACE, SEMI) val ENSURE_SPACE_BEFORE = Set( - ABSTRACT, CASE, CATCH, CLASS, DEF, + ABSTRACT, CASE, CATCH, CLASS, DEF, /* DO, */ ELSE, EXTENDS, FINAL, - FINALLY, /* FOR, */ FORSOME, /* IF, */ IMPLICIT, + FINALLY, /* FOR, */ FORSOME, /* IF, */ IMPLICIT, /* IMPORT, */ LAZY, MATCH, /* NEW, */ OBJECT, OVERRIDE, /* PACKAGE, */ PRIVATE, PROTECTED, /* RETURN, */ SEALED, /* SUPER, THIS, */ /* THROW, */ TRAIT, /* TRY, TYPE, */ - VAL, VAR, /* WHILE, */ WITH, YIELD, + VAL, VAR, /* WHILE, */ WITH, YIELD, /* USCORE, COLON, */ EQUALS, /* ARROW, */ LARROW, RARROW, SUBTYPE, VIEWBOUND, SUPERTYPE, /*, HASH, AT, */ RBRACE) // format: ON diff --git a/scalariform/src/main/scala/scalariform/formatter/SpecificFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/SpecificFormatter.scala index 82bac11a..1fd3e893 100644 --- a/scalariform/src/main/scala/scalariform/formatter/SpecificFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/SpecificFormatter.scala @@ -27,7 +27,6 @@ trait SpecificFormatter { def fullFormat(source: String, lineDelimiter: Option[String] = None, scalaVersion: String = ScalaVersions.DEFAULT_VERSION)(baseFormattingPreferences: IFormattingPreferences): (List[TextEdit], FormatResult) = { import scalariform.parser._ - val startTime = System.currentTimeMillis val tokens = ScalaLexer.tokenise(source, scalaVersion = scalaVersion) if (debug) { println @@ -56,9 +55,6 @@ trait SpecificFormatter { parseResult) if (debug) { println("Parse result: " + parseResult) } - val elapsedTime = System.currentTimeMillis - startTime - // if (debug) - // println("Parse time = " + elapsedTime + "ms") val newlineSequence_ = lineDelimiter.getOrElse(if (source contains "\r\n") "\r\n" else "\n") val formatter = new ScalaFormatter() { diff --git a/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala index d201fb5b..abecd6ec 100644 --- a/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala @@ -10,7 +10,7 @@ import scalariform.formatter.preferences._ trait TemplateFormatter { self: HasFormattingPreferences with AnnotationFormatter with HasHiddenTokenInfo with TypeFormatter with ExprFormatter with ScalaFormatter ⇒ def format(tmplDef: TmplDef)(implicit formatterState: FormatterState): FormatResult = { - val TmplDef(markerTokens, name, typeParamClauseOpt, annotations, accessModifierOpt, paramClausesOpt, templateInheritanceSectionOpt, templateBodyOption) = tmplDef + val TmplDef(_, _, typeParamClauseOpt, annotations, accessModifierOpt, paramClausesOpt, templateInheritanceSectionOpt, templateBodyOption) = tmplDef var formatResult: FormatResult = NoFormatResult for (typeParamClause ← typeParamClauseOpt) formatResult ++= format(typeParamClause.contents) diff --git a/scalariform/src/main/scala/scalariform/formatter/XmlFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/XmlFormatter.scala index 188ce8f7..06c5521a 100644 --- a/scalariform/src/main/scala/scalariform/formatter/XmlFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/XmlFormatter.scala @@ -15,7 +15,7 @@ trait XmlFormatter { self: HasFormattingPreferences with ExprFormatter with Scal val nestedFormatterState = if (formattingPreferences(IndentWithTabs)) formatterState else formatterState.alignWithToken(first.firstToken) - val (contentsFormatResult, multiline) = format(otherElements)(formatterState, nestedFormatterState) + val (contentsFormatResult, _) = format(otherElements)(formatterState, nestedFormatterState) formatResult ++= contentsFormatResult formatResult } else @@ -32,7 +32,7 @@ trait XmlFormatter { self: HasFormattingPreferences with ExprFormatter with Scal } def format(xmlEmpty: XmlEmptyElement)(implicit formatterState: FormatterState): FormatResult = { - val XmlEmptyElement(startOpen, name, attributes: List[(Option[Token], XmlAttribute)], whitespaceOption, emptyClose) = xmlEmpty + val XmlEmptyElement(_, _, attributes: List[(Option[Token], XmlAttribute)], whitespaceOption, _) = xmlEmpty var formatResult: FormatResult = NoFormatResult for ((whitespaceOption2, attribute) ← attributes) { for (whitespace ← whitespaceOption2 if formattingPreferences(FormatXml)) @@ -46,7 +46,7 @@ trait XmlFormatter { self: HasFormattingPreferences with ExprFormatter with Scal // TODO: Dup with XmlEmptyElement def format(xmlStart: XmlStartTag)(implicit formatterState: FormatterState): FormatResult = { - val XmlStartTag(startOpen, name, attributes: List[(Option[Token], XmlAttribute)], whitespaceOption, tagClose) = xmlStart + val XmlStartTag(_, _, attributes: List[(Option[Token], XmlAttribute)], whitespaceOption, _) = xmlStart var formatResult: FormatResult = NoFormatResult for ((whitespaceOption2, attribute) ← attributes) { for (whitespace ← whitespaceOption2 if formattingPreferences(FormatXml)) @@ -59,7 +59,7 @@ trait XmlFormatter { self: HasFormattingPreferences with ExprFormatter with Scal } def format(xmlEnd: XmlEndTag)(implicit formatterState: FormatterState): FormatResult = { - val XmlEndTag(endOpen, name, whitespaceOption, tagClose) = xmlEnd + val XmlEndTag(_, _, whitespaceOption, _) = xmlEnd var formatResult: FormatResult = NoFormatResult for (whitespace ← whitespaceOption if formattingPreferences(FormatXml)) formatResult = formatResult.replaceXml(whitespace, "") @@ -67,7 +67,7 @@ trait XmlFormatter { self: HasFormattingPreferences with ExprFormatter with Scal } def format(xmlAttribute: XmlAttribute)(implicit formatterState: FormatterState): FormatResult = { - val XmlAttribute(name, whitespaceOption, equals, whitespaceOption2, valueOrEmbeddedScala: Either[Token, Expr]) = xmlAttribute + val XmlAttribute(_, whitespaceOption, _, whitespaceOption2, valueOrEmbeddedScala: Either[Token, Expr]) = xmlAttribute var formatResult: FormatResult = NoFormatResult for (whitespace ← whitespaceOption if formattingPreferences(FormatXml)) formatResult = formatResult.replaceXml(whitespace, "") @@ -146,4 +146,3 @@ trait XmlFormatter { self: HasFormattingPreferences with ExprFormatter with Scal } } - diff --git a/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala b/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala index f5c68127..5fead363 100644 --- a/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala +++ b/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala @@ -14,7 +14,7 @@ trait ModeStack { self: ScalaLexer ⇒ modeStack.push(new ScalaMode) protected def popMode() { - val mode = modeStack.pop() + modeStack.pop() } protected def isRootMode = modeStack.size == 1 diff --git a/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala b/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala index cf9ec5b3..afc969ed 100644 --- a/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala @@ -108,9 +108,6 @@ class NewlineInferencer(delegate: WhitespaceAndCommentsGrouper) extends Iterator return previousToken != null && (TOKENS_WHICH_CAN_END_A_STATEMENT contains previousToken.tokenType) } - private def followingTokenIsClassOrObject(nextToken: Token): Boolean = - nextToken != null && (nextToken.tokenType == CLASS || nextToken.tokenType == OBJECT) - private def containsBlankLine(s: String): Boolean = { var i = 0 var inBlankLine = false diff --git a/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala index f4066f82..d4491139 100644 --- a/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala @@ -129,10 +129,6 @@ class ScalaLexer( untilEof -= 1 } - // For debug - private def bufferContents: String = - (for (n ← 0 until charsInBuffer) yield charBuffer((bufferStart + n) & BUFFER_MASK)).mkString - /** * Mark the end of a token of the given type. */ @@ -271,7 +267,7 @@ object ScalaLexer { private val BUFFER_MASK = BUFFER_SIZE - 1 - private def makeRawLexer(s: String, forgiveErrors: Boolean = false, scalaVersion: ScalaVersion = ScalaVersions.DEFAULT): ScalaLexer = + private def makeRawLexer(s: String, forgiveErrors: Boolean, scalaVersion: ScalaVersion): ScalaLexer = new ScalaLexer(new UnicodeEscapeReader(s, forgiveErrors), forgiveErrors, scalaVersion) } diff --git a/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala b/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala index b3104699..8d36e704 100644 --- a/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala @@ -14,10 +14,6 @@ trait XmlLexer { self: ScalaLexer ⇒ private def tagMode = xmlMode.isTagMode - private def tagMode_=(isTagMode: Boolean) { - xmlMode.isTagMode = isTagMode - } - private def moreXmlToCome: Boolean = { // Amount of scanning ahead required is unlimited, so we can't use the circular buffer: val newReader = reader.copy.buffered diff --git a/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala index 7707f71f..7b73b195 100644 --- a/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala @@ -160,8 +160,6 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { case _ ⇒ false } - private def isTypeIntro: Boolean = isTypeIntroToken(currentTokenType) - private def isStatSeqEnd = RBRACE || EOF private def isStatSep(tokenType: TokenType) = @@ -398,7 +396,7 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { else throw new ScalaParserException("illegal literal: " + currentToken) - private def interpolatedString(inPattern: Boolean = false) { + private def interpolatedString(inPattern: Boolean) { nextToken() while (STRING_PART) { nextToken() @@ -415,7 +413,7 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { } if (!STRING_LITERAL) // TODO: Can it be absent, as allowed by Scalac? throw new ScalaParserException("Unexpected conclusion to string interpolation: " + currentToken) - val terminalString = nextToken() + nextToken() } private def newLineOpt() { if (NEWLINE) nextToken() } @@ -453,11 +451,6 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { typeBounds() } - private def equalsExpr() = { - accept(EQUALS) - expr() - } - private def condExpr() = { if (LPAREN) { nextToken() @@ -498,22 +491,21 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { case LPAREN ⇒ inParens(expr()) case _ ⇒ expr } - val catchClauseOption = - if (!CATCH) - None + if (!CATCH) + None + else { + nextToken() + if (!LBRACE) + expr() else { - nextToken() - if (!LBRACE) - expr() - else { - inBraces { - if (CASE) - caseClauses() - else - expr() - } + inBraces { + if (CASE) + caseClauses() + else + expr() } } + } currentTokenType match { case FINALLY ⇒ nextToken() @@ -537,7 +529,6 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { case FOR ⇒ nextToken() - val (open, close) = if (LBRACE) (LBRACE, RBRACE) else (LPAREN, RPAREN) if (LBRACE) inBraces(enumerators()) else inParens(enumerators()) newLinesOpt() @@ -556,7 +547,7 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { expr() case IMPLICIT ⇒ - val implicitToken = nextToken() + nextToken() List(implicitClosure(location)) case _ ⇒ @@ -601,18 +592,6 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { if (location != InBlock) expr() else block() } - private final val otherLetters = Set[Char]('\u0024', '\u005F') // '$' and '_' - private final val letterGroups = { - import java.lang.Character._ - Set[Byte](LOWERCASE_LETTER, UPPERCASE_LETTER, OTHER_LETTER, TITLECASE_LETTER, LETTER_NUMBER) - } - private def isScalaLetter(ch: Char) = letterGroups(java.lang.Character.getType(ch).toByte) || otherLetters(ch) - - private def isOpAssignmentName(name: String) = name match { - case "!=" | "<=" | ">=" | "" ⇒ false - case _ ⇒ name.endsWith("=") && !name.startsWith("=") && Chars.isOperatorPart(name(0)) - } - private def postfixExpr() { prefixExpr() while (isIdent) { @@ -663,7 +642,8 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { } private def simpleExprRest(canApply: Boolean) { - val newLineOpt = if (canApply) newLineOptWhenFollowedBy(LBRACE) else None + if (canApply) + newLineOptWhenFollowedBy(LBRACE) currentTokenType match { case DOT ⇒ nextToken() @@ -788,7 +768,7 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { def pattern1() { pattern2() - if (COLON) { // TODO: case Ident(name) if (treeInfo.isVarPattern(p) && in.token == COLON) + if (COLON) { nextToken() compoundType() } @@ -1014,7 +994,7 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { private def typeParamClauseOpt(allowVariance: Boolean) { def typeParam() { - if (allowVariance && isIdent) { // TODO: condition + if (allowVariance && isIdent) { // TODO: condition if (PLUS) nextToken() else if (MINUS) @@ -1127,7 +1107,7 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { if (EQUALS) { // TODO: Check cond accept(EQUALS) // Skip USCORE check: will be handled by expr() anyway - // if (USCORE) { // TODO: check cond + // if (USCORE) { // TODO: check cond // nextToken() // } else @@ -1343,7 +1323,8 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { else None } - val statSepOpt = if (!RBRACE && !EOF) acceptStatSep() else None + if (!RBRACE && !EOF) + acceptStatSep() } } @@ -1376,13 +1357,13 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { private def refineStatSeq() { while (!isStatSeqEnd) { - if (isDclIntro) { + if (isDclIntro) defOrDcl() - } else if (!isStatSep) + else if (!isStatSep) throw new ScalaParserException("illegal start of definition: " + currentToken) - else - None - val statSepOpt = if (!RBRACE) acceptStatSep() else None + + if (!RBRACE) + acceptStatSep() } } @@ -1608,12 +1589,6 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { ((first.isLower && first.isLetter) || first == '_') } - private def isVarPattern(token: Token) = { - isIdent(token.tokenType) && - isVariableName(token.text) && - !token.text.startsWith("`") - } - private def optional[T](p: ⇒ T): Option[T] = or(Some(p), None) @@ -1639,4 +1614,3 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { } } - diff --git a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala index c34fd882..ad9f839a 100644 --- a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala @@ -153,8 +153,6 @@ class ScalaParser(tokens: Array[Token]) { case _ ⇒ false } - private def isTypeIntro: Boolean = isTypeIntroToken(currentTokenType) - private def isStatSeqEnd = RBRACE || EOF private def isStatSep(tokenType: TokenType) = @@ -432,7 +430,7 @@ class ScalaParser(tokens: Array[Token]) { else throw new ScalaParserException("illegal literal: " + currentToken) - private def interpolatedString(inPattern: Boolean = false): StringInterpolation = { + private def interpolatedString(inPattern: Boolean): StringInterpolation = { val interpolationId = nextToken() val stringPartsAndScala = ListBuffer[(Token, Expr)]() while (STRING_PART) { @@ -508,7 +506,7 @@ class ScalaParser(tokens: Array[Token]) { val rparen = accept(RPAREN) CondExpr(lparen, expr_, rparen) } else { - val lparen = accept(LPAREN) + accept(LPAREN) // Seriously, WTF? throw new ScalaParserException("Straggling lparen thing") } @@ -592,7 +590,6 @@ class ScalaParser(tokens: Array[Token]) { case FOR ⇒ val forToken = nextToken() - val (open, close) = if (LBRACE) (LBRACE, RBRACE) else (LPAREN, RPAREN) val (lParenOrBrace, enumerators_, rParenOrBrace) = if (LBRACE) inBraces(enumerators()) else inParens(enumerators()) @@ -718,11 +715,6 @@ class ScalaParser(tokens: Array[Token]) { } } - private def rotateRight(infixExpr: InfixExpr): InfixExpr = { - val NestedInfixExpr(x, op1, newLineOpt1, y, op2, newLineOpt2, z) = infixExpr - InfixExpr(x, op1, newLineOpt1, List(InfixExpr(y, op2, newLineOpt2, z))) - } - private def performRotationsForPrecedence(infixExpr: InfixExpr): InfixExpr = infixExpr match { case NestedInfixExpr(x, op1, newLineOpt1, y, op2, newLineOpt2, z) if hasHigherPrecedence(op2, op1) ⇒ InfixExpr(x, op1, newLineOpt1, List(performRotationsForPrecedence(InfixExpr(y, op2, newLineOpt2, z)))) @@ -765,19 +757,6 @@ class ScalaParser(tokens: Array[Token]) { simpleExpr() } - private object PathEndingWithDotId { - def unapply(tokens: List[Token]) = condOpt(tokens.reverse) { - case (lastIdToken) :: dot :: rest if (lastIdToken.tokenType.isId || lastIdToken.tokenType == THIS) && dot.tokenType == DOT ⇒ - (rest.reverse, dot, lastIdToken) - } - } - - private object JustIdOrThis { - def unapply(tokens: List[Token]) = condOpt(tokens) { - case List(idToken) if (idToken.tokenType.isId || idToken.tokenType == THIS) ⇒ idToken - } - } - private def simpleExpr(): List[ExprElement] = { var canApply = true val firstPart = @@ -973,7 +952,7 @@ class ScalaParser(tokens: Array[Token]) { def pattern1(): Expr = { val firstPattern = pattern2() - val colonTypeOpt = if (COLON) { // TODO: case Ident(name) if (treeInfo.isVarPattern(p) && in.token == COLON) + val colonTypeOpt = if (COLON) { val colonToken = nextToken() val compoundType_ = Some(TypeExprElement(compoundType())) Some(colonToken, compoundType_) @@ -1246,7 +1225,7 @@ class ScalaParser(tokens: Array[Token]) { private def typeParamClauseOpt(allowVariance: Boolean): Option[TypeParamClause] = { def typeParam(): TypeParam = { val typeElements = ListBuffer[TypeElementFlattenable]() - if (allowVariance && isIdent) { // TODO: condition + if (allowVariance && isIdent) { // TODO: condition if (PLUS) typeElements += VarianceTypeElement(nextToken()) else if (MINUS) @@ -1374,7 +1353,7 @@ class ScalaParser(tokens: Array[Token]) { val equalsClauseOption = if (EQUALS) { // TODO: Check cond val equalsToken = accept(EQUALS) // Skip USCORE check: will be handled by expr() anyway - // if (USCORE) { // TODO: check cond + // if (USCORE) { // TODO: check cond // nextToken() // } else @@ -1983,12 +1962,6 @@ class ScalaParser(tokens: Array[Token]) { ((first.isLower && first.isLetter) || first == '_') } - private def isVarPattern(token: Token) = { - isIdent(token.tokenType) && - isVariableName(token.text) && - !token.text.startsWith("`") - } - private def optional[T](p: ⇒ T): Option[T] = or(Some(p), None) @@ -2013,16 +1986,6 @@ class ScalaParser(tokens: Array[Token]) { None } - private def log[T](s: String)(f: ⇒ T): T = { - if (logging) { - println("Enter " + s + " [" + currentToken + "]") - val result = f - println("Exit " + s + " [" + currentToken + "]") - result - } else - f - } - } object ScalaParser { @@ -2108,4 +2071,3 @@ case class TemplateOpt(templateInheritanceSectionOpt: Option[TemplateInheritance case class PrePackageBlock(name: CallExpr, newlineOpt: Option[Token], lbrace: Token, topStats: StatSeq, rbrace: Token) { def complete(packageToken: Token) = PackageBlock(packageToken, name, newlineOpt, lbrace, topStats, rbrace) } - diff --git a/scalariform/src/main/scala/scalariform/utils/CaseClassReflector.scala b/scalariform/src/main/scala/scalariform/utils/CaseClassReflector.scala index 3b4dcf96..a64e6fb4 100644 --- a/scalariform/src/main/scala/scalariform/utils/CaseClassReflector.scala +++ b/scalariform/src/main/scala/scalariform/utils/CaseClassReflector.scala @@ -7,13 +7,4 @@ trait CaseClassReflector extends Product { names.toList zip productIterator.toList } - private def getFieldsOld: List[(String, Any)] = { - var fieldValueToName: Map[Any, String] = Map() - for (field ← getClass.getDeclaredFields) { - field.setAccessible(true) - fieldValueToName += (field.get(this) -> field.getName) - } - productIterator.toList map { value ⇒ fieldValueToName(value) -> value } - } - } From 424fed2e3c3d092d79f560199cdd85848cdcf6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 15:34:53 +0100 Subject: [PATCH 15/32] Solve warnings about vars that could be vals --- .../src/main/scala/scalariform/formatter/ExprFormatter.scala | 4 ++-- .../src/main/scala/scalariform/parser/ScalaParser.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala index 6f2ac945..86af9db3 100755 --- a/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala @@ -327,7 +327,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi val alignArgsEnabled = formattingPreferences(AlignArguments) && !formattingPreferences(IndentWithTabs) var formatResult: FormatResult = NoFormatResult - var argumentFormatterState = formatterState + val argumentFormatterState = formatterState val ParenArgumentExprs(_, contents, _) = parenArguments /* Force a newline for the first argument if this is a set of @@ -976,7 +976,7 @@ trait ExprFormatter { self: HasFormattingPreferences with AnnotationFormatter wi def formatParamClauses(paramClauses: ParamClauses, doubleIndentParams: Boolean = false)(implicit formatterState: FormatterState): FormatResult = { val ParamClauses(_, paramClausesAndNewlines) = paramClauses var formatResult: FormatResult = NoFormatResult - var currentFormatterState = formatterState + val currentFormatterState = formatterState for ((paramClause, newlineOption) ← paramClausesAndNewlines) { // TODO: Newlines. // maybe already done in some cases by format(tmplDef)? val (paramClauseFormatResult, _) = formatParamClause(paramClause, doubleIndentParams)(currentFormatterState) formatResult ++= paramClauseFormatResult diff --git a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala index ad9f839a..c332e473 100644 --- a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala @@ -1632,7 +1632,7 @@ class ScalaParser(tokens: Array[Token]) { private def templateStatSeq(): StatSeq = { val statAndStatSeps = ListBuffer[(Option[Stat], Option[Token])]() - var selfReferenceOpt = if (isExprIntro) { + val selfReferenceOpt = if (isExprIntro) { val expr_ = expr(InTemplate) if (ARROW) { val arrowToken = nextToken() From 1f1de21289bd1115d34722dc638fdffb0a78c5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 15:47:05 +0100 Subject: [PATCH 16/32] Fix warnings about automatic wrapping in parenthesis --- .../scalariform/parser/ScalaParser.scala | 77 +++++++++---------- .../scala/scalariform/utils/Trimmed.scala | 2 +- 2 files changed, 36 insertions(+), 43 deletions(-) diff --git a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala index c332e473..5fc8c278 100644 --- a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala @@ -347,7 +347,7 @@ class ScalaParser(tokens: Array[Token]) { val dot = accept(DOT) val id = selector() val subBaseCall = CallExpr(None, superToken, mixinQualifierOpt_) - val baseCall = CallExpr(Some(List(subBaseCall), dot), id) + val baseCall = CallExpr(Some((List(subBaseCall), dot)), id) if (DOT) { val dot2 = nextToken() selectors((baseCall, dot2), typeOK) @@ -360,7 +360,7 @@ class ScalaParser(tokens: Array[Token]) { val dot = nextToken() if (THIS) { val thisToken = nextToken() - val baseCall2 = CallExpr(Some(List(baseCall), dot), thisToken) + val baseCall2 = CallExpr(Some((List(baseCall), dot)), thisToken) if (!thisOK || DOT) { val dot2 = accept(DOT) selectors((baseCall2, dot2), typeOK) @@ -371,7 +371,7 @@ class ScalaParser(tokens: Array[Token]) { val mixinQualifierOpt_ = mixinQualifierOpt() val dot2 = accept(DOT) val id2 = selector() - val baseCall2 = CallExpr(Some(List(CallExpr(Some(List(baseCall), dot), superToken, mixinQualifierOpt_)), dot2), id2) + val baseCall2 = CallExpr(Some((List(CallExpr(Some((List(baseCall), dot)), superToken, mixinQualifierOpt_)), dot2)), id2) if (DOT) { val dot3 = nextToken() selectors((baseCall2, dot3), typeOK) @@ -387,7 +387,7 @@ class ScalaParser(tokens: Array[Token]) { private def path(thisOK: Boolean, typeOK: Boolean): List[Token] = pathC(thisOK, typeOK).tokens private def selectors(previousAndDot: (CallExpr, Token), typeOK: Boolean): CallExpr = { - val exprDotOpt = Some(exprElementFlatten2(previousAndDot._1), previousAndDot._2) + val exprDotOpt = Some((exprElementFlatten2(previousAndDot._1), previousAndDot._2)) if (typeOK && TYPE) CallExpr(exprDotOpt, nextToken()) else { @@ -471,11 +471,9 @@ class ScalaParser(tokens: Array[Token]) { None private def typedOpt(): Option[(Token, Type)] = - if (COLON) { - val colonToken = nextToken() - val typ_ = typ() - Some(colonToken, typ_) - } else + if (COLON) + Some((nextToken(), typ())) + else None private def typeOrInfixType(location: Location): TypeExprElement = @@ -567,7 +565,7 @@ class ScalaParser(tokens: Array[Token]) { case FINALLY ⇒ val finallyToken = nextToken() val finallyExpr = expr() - Some(finallyToken, finallyExpr) + Some((finallyToken, finallyExpr)) case _ ⇒ None } @@ -604,12 +602,12 @@ class ScalaParser(tokens: Array[Token]) { case RETURN ⇒ val returnToken = nextToken() val returnExpr = if (isExprIntro) Some(expr()) else None - exprElementFlatten2(returnToken, returnExpr) // TODO: <-- use a different type? + exprElementFlatten2((returnToken, returnExpr)) // TODO: <-- use a different type? case THROW ⇒ val throwToken = nextToken() val throwExpr = expr() - exprElementFlatten2(throwToken, throwExpr) + exprElementFlatten2((throwToken, throwExpr)) case IMPLICIT ⇒ val implicitToken = nextToken() @@ -630,7 +628,7 @@ class ScalaParser(tokens: Array[Token]) { val rhs = if (USCORE) { val uscore = nextToken() val star = accept(STAR) - exprElementFlatten2(uscore, star) + exprElementFlatten2((uscore, star)) } else if (AT) { annotations(skipNewLines = false) } else { @@ -670,12 +668,12 @@ class ScalaParser(tokens: Array[Token]) { val colonTypeOpt = if (COLON) { val colonToken = nextToken() val type_ = typeOrInfixType(location) - Some(colonToken, type_) + Some((colonToken, type_)) } else None val arrowToken = accept(ARROW) val body: StatSeq = if (location != InBlock) StatSeq(None, Some(expr()), Nil) else block() - AnonymousFunction(exprElementFlatten2(implicitToken, id, colonTypeOpt), arrowToken, body) + AnonymousFunction(exprElementFlatten2((implicitToken, id, colonTypeOpt)), arrowToken, body) } private final val otherLetters = Set[Char]('\u0024', '\u005F') // '$' and '_' @@ -750,9 +748,9 @@ class ScalaParser(tokens: Array[Token]) { val unaryId = PrefixExprElement(ident()) if (isMinus && isNumericLit) { val literal_ = literal() - simpleExprRest(exprElementFlatten2(unaryId, literal_), true) + simpleExprRest(exprElementFlatten2((unaryId, literal_)), true) } else - List(Expr(exprElementFlatten2(unaryId, simpleExpr()))) + List(Expr(exprElementFlatten2((unaryId, simpleExpr())))) } else simpleExpr() } @@ -793,7 +791,7 @@ class ScalaParser(tokens: Array[Token]) { require(newLineOpt.isEmpty) val dot = nextToken() val selector_ = selector() - val callExpr = CallExpr(Some(previousPart, dot), selector_, None, Nil, None) + val callExpr = CallExpr(Some((previousPart, dot)), selector_, None, Nil, None) simpleExprRest(List(callExpr), canApply = true) case LBRACKET ⇒ require(newLineOpt.isEmpty) @@ -803,10 +801,10 @@ class ScalaParser(tokens: Array[Token]) { val updatedPart = previousPart match { case List(callExpr: CallExpr) ⇒ if (callExpr.typeArgsOpt.isDefined || callExpr.newLineOptsAndArgumentExprss.nonEmpty) - exprElementFlatten2(previousPart, newLineOpt, typeArgs_) // TODO: put these into some new type of AST node + exprElementFlatten2((previousPart, newLineOpt, typeArgs_)) // TODO: put these into some new type of AST node else List(callExpr.copy(typeArgsOpt = Some(typeArgs_))) - case _ ⇒ exprElementFlatten2(previousPart, newLineOpt, typeArgs_) + case _ ⇒ exprElementFlatten2((previousPart, newLineOpt, typeArgs_)) } simpleExprRest(updatedPart, canApply = true) } else @@ -814,8 +812,8 @@ class ScalaParser(tokens: Array[Token]) { case LPAREN | LBRACE if canApply ⇒ val argumentExprs_ = argumentExprs().get val updatedPart = previousPart match { - case List(callExpr: CallExpr) ⇒ List(callExpr.copy(newLineOptsAndArgumentExprss = callExpr.newLineOptsAndArgumentExprss :+ (newLineOpt, argumentExprs_))) - case _ ⇒ exprElementFlatten2(previousPart, newLineOpt, argumentExprs_) + case List(callExpr: CallExpr) ⇒ List(callExpr.copy(newLineOptsAndArgumentExprss = callExpr.newLineOptsAndArgumentExprss :+ ((newLineOpt, argumentExprs_)))) + case _ ⇒ exprElementFlatten2((previousPart, newLineOpt, argumentExprs_)) } simpleExprRest(updatedPart, canApply = true) case USCORE ⇒ @@ -955,7 +953,7 @@ class ScalaParser(tokens: Array[Token]) { val colonTypeOpt = if (COLON) { val colonToken = nextToken() val compoundType_ = Some(TypeExprElement(compoundType())) - Some(colonToken, compoundType_) + Some((colonToken, compoundType_)) } else None makeExpr(firstPattern, colonTypeOpt) @@ -984,10 +982,10 @@ class ScalaParser(tokens: Array[Token]) { lookahead(1) match { case RBRACE if isXML ⇒ val starToken = nextToken() - return exprElementFlatten2(simplePattern1, starToken) + return exprElementFlatten2((simplePattern1, starToken)) case RPAREN if !isXML ⇒ val starToken = nextToken() - return exprElementFlatten2(simplePattern1, starToken) + return exprElementFlatten2((simplePattern1, starToken)) case _ ⇒ } case _ ⇒ @@ -1019,7 +1017,7 @@ class ScalaParser(tokens: Array[Token]) { if (LBRACKET) Some(List(TypeExprElement(typeArgs()))) else None val argumentPatternsOpt = if (LPAREN) Some(argumentPatterns()) else None - exprElementFlatten2((id, literalOpt), typeArgsOpt, argumentPatternsOpt) + exprElementFlatten2(((id, literalOpt), typeArgsOpt, argumentPatternsOpt)) case USCORE ⇒ exprElementFlatten2(nextToken()) case CHARACTER_LITERAL | INTEGER_LITERAL | FLOATING_POINT_LITERAL | STRING_LITERAL | INTERPOLATION_ID | @@ -1027,7 +1025,7 @@ class ScalaParser(tokens: Array[Token]) { exprElementFlatten2(literal(inPattern = true)) case LPAREN ⇒ val (lparen, patterns_, rparen) = makeParens(noSeq.patterns) - exprElementFlatten2(lparen, patterns_, rparen) + exprElementFlatten2((lparen, patterns_, rparen)) case XML_START_OPEN | XML_COMMENT | XML_CDATA | XML_UNPARSED | XML_PROCESSING_INSTRUCTION ⇒ exprElementFlatten2(xmlLiteralPattern()) case _ ⇒ @@ -1069,7 +1067,7 @@ class ScalaParser(tokens: Array[Token]) { private def argumentPatterns(): List[ExprElement] = { val (lparen, patterns_, rparen) = inParens { if (RPAREN) Nil else seqPatterns() } - exprElementFlatten2(lparen, patterns_, rparen) + exprElementFlatten2((lparen, patterns_, rparen)) } private def accessQualifierOpt(): Option[AccessQualifier] = @@ -1165,12 +1163,10 @@ class ScalaParser(tokens: Array[Token]) { val id = ident() if (COLON || !forgiving) { val colonToken = accept(COLON) - val paramType_ = paramType() - val paramTypeOpt = Some(colonToken, paramType_) + val paramTypeOpt = Some((colonToken, paramType())) val defaultValueOpt = if (EQUALS) { val equalsToken = nextToken() - val expr_ = expr() - Some(equalsToken, expr_) + Some((equalsToken, expr())) } else None Param(annotations_, modifiers_.toList, valOrVarOpt, id, paramTypeOpt, defaultValueOpt) @@ -1261,11 +1257,9 @@ class ScalaParser(tokens: Array[Token]) { } private def bound(tokenType: TokenType): Option[(Token, Type)] = { - if (tokenType) { - val token = nextToken() - val type_ = typ() - Some(token, type_) - } else + if (tokenType) + Some((nextToken(), typ())) + else None } @@ -1302,7 +1296,7 @@ class ScalaParser(tokens: Array[Token]) { val id = ident() if (DOT) { val dot = nextToken() - loop(idDots :+ (id, dot)) + loop(idDots :+ ((id, dot))) } else makeExpr(initialSelection, idDots, id) } @@ -1358,7 +1352,7 @@ class ScalaParser(tokens: Array[Token]) { // } else val clause = expr() - Some(equalsToken, clause) + Some((equalsToken, clause)) } else None PatDefOrDcl(valOrVarToken, pattern_, otherPatterns.toList, typedOpt_, equalsClauseOption) @@ -1455,8 +1449,7 @@ class ScalaParser(tokens: Array[Token]) { val extraTypeDclStuff = currentTokenType match { case EQUALS ⇒ val equalsToken = nextToken() - val typ_ = typ() - Left(equalsToken, typ_) + Left((equalsToken, typ())) case SUPERTYPE | SUBTYPE | SEMI | NEWLINE | NEWLINES | COMMA | RBRACE | EOF /* <-- for Scalariform tests */ ⇒ val typeBounds_ = typeBounds() Right(typeBounds_) @@ -1782,7 +1775,7 @@ class ScalaParser(tokens: Array[Token]) { if (initialSemis.isEmpty) otherStatSeq else { - val otherStats = (initialSemis.init.toList.map((_, None)) :+ (initialSemis.last, otherStatSeq.firstStatOpt)) ++ otherStatSeq.otherStats + val otherStats = (initialSemis.init.toList.map((_, None)) :+ ((initialSemis.last, otherStatSeq.firstStatOpt))) ++ otherStatSeq.otherStats StatSeq(selfReferenceOpt = None, firstStatOpt = None, otherStats = otherStats) } } diff --git a/scalariform/src/main/scala/scalariform/utils/Trimmed.scala b/scalariform/src/main/scala/scalariform/utils/Trimmed.scala index 3f139fc9..668b204d 100644 --- a/scalariform/src/main/scala/scalariform/utils/Trimmed.scala +++ b/scalariform/src/main/scala/scalariform/utils/Trimmed.scala @@ -7,7 +7,7 @@ object Trimmed { def unapply(s: String): Option[(String, String, String)] = { val (prefix, rest) = s span Character.isWhitespace val (revSuffix, revInfix) = rest.reverse span Character.isWhitespace - Some(prefix, revInfix.reverse, revSuffix.reverse) + Some((prefix, revInfix.reverse, revSuffix.reverse)) } } From 892fc622a8b161c8b7c58b5ff769f6ce962e0607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 15:50:56 +0100 Subject: [PATCH 17/32] Remove unused imports --- .../src/main/scala/scalariform/astselect/AstSelector.scala | 1 - .../src/main/scala/scalariform/formatter/Alignment.scala | 3 +-- .../scala/scalariform/formatter/AnnotationFormatter.scala | 2 -- .../scala/scalariform/formatter/CaseClauseFormatter.scala | 2 -- .../main/scala/scalariform/formatter/CommentFormatter.scala | 2 -- .../src/main/scala/scalariform/formatter/ExprFormatter.scala | 1 - .../src/main/scala/scalariform/formatter/FormatResult.scala | 3 --- .../scalariform/formatter/FormatterDirectiveParser.scala | 1 - .../src/main/scala/scalariform/formatter/ScalaFormatter.scala | 2 -- .../main/scala/scalariform/formatter/TemplateFormatter.scala | 2 -- .../src/main/scala/scalariform/formatter/TypeFormatter.scala | 4 +--- .../src/main/scala/scalariform/lexer/HiddenTokens.scala | 1 - scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala | 1 - .../src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala | 1 - scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala | 2 -- .../scalariform/parser/InferredSemicolonScalaParser.scala | 1 - 16 files changed, 2 insertions(+), 27 deletions(-) diff --git a/scalariform/src/main/scala/scalariform/astselect/AstSelector.scala b/scalariform/src/main/scala/scalariform/astselect/AstSelector.scala index ebdb79fb..958ad24d 100644 --- a/scalariform/src/main/scala/scalariform/astselect/AstSelector.scala +++ b/scalariform/src/main/scala/scalariform/astselect/AstSelector.scala @@ -3,7 +3,6 @@ package scalariform.astselect import scalariform.lexer._ import scalariform.parser._ import scalariform.utils.Range -import scalariform.utils.Utils._ import scala.util.control.Exception._ import scalariform.ScalaVersions diff --git a/scalariform/src/main/scala/scalariform/formatter/Alignment.scala b/scalariform/src/main/scala/scalariform/formatter/Alignment.scala index bb6b07a3..6fbdedfa 100644 --- a/scalariform/src/main/scala/scalariform/formatter/Alignment.scala +++ b/scalariform/src/main/scala/scalariform/formatter/Alignment.scala @@ -2,10 +2,9 @@ package scalariform.formatter import scalariform.parser._ import Math._ -import scalariform.formatter.preferences._ // For now, this is just a place to store alignment related functionality. -// TOOD: refactor duplicate behavior in here +// TOOD: refactor duplicate behavior in here object Alignment { type EitherAlignableParam = Either[ConsecutiveSingleLineParams, Param] type EitherAlignableEqualsExpr = Either[ConsecutiveSingleLineEqualsExprs, CallExpr] diff --git a/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala index f762ef62..192d61d0 100644 --- a/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/AnnotationFormatter.scala @@ -1,8 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.utils._ -import scalariform.lexer._ import scalariform.formatter.preferences._ trait AnnotationFormatter { self: HasFormattingPreferences with TypeFormatter with ExprFormatter ⇒ diff --git a/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala index 074be2ef..d228ca5f 100644 --- a/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/CaseClauseFormatter.scala @@ -1,11 +1,9 @@ package scalariform.formatter import scalariform.lexer.Token -import scalariform.lexer.Tokens._ import scalariform.parser._ import scalariform.utils.Utils import scalariform.utils.TextEditProcessor -import scalariform.utils.BooleanLang._ import scalariform.formatter.preferences._ import Alignment._ import PartialFunction._ diff --git a/scalariform/src/main/scala/scalariform/formatter/CommentFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/CommentFormatter.scala index ad49d759..f9157da6 100644 --- a/scalariform/src/main/scala/scalariform/formatter/CommentFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/CommentFormatter.scala @@ -1,7 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.utils._ import scalariform.lexer._ import scalariform.formatter.preferences._ import scala.annotation.tailrec diff --git a/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala index 86af9db3..4fadab75 100755 --- a/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/ExprFormatter.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.formatter.Alignment._ -import scalariform.formatter.AnnotationFormatter import scalariform.lexer.Chars import scalariform.lexer.Token import scalariform.lexer.Tokens._ diff --git a/scalariform/src/main/scala/scalariform/formatter/FormatResult.scala b/scalariform/src/main/scala/scalariform/formatter/FormatResult.scala index 54de6ebf..1a2ca282 100644 --- a/scalariform/src/main/scala/scalariform/formatter/FormatResult.scala +++ b/scalariform/src/main/scala/scalariform/formatter/FormatResult.scala @@ -1,9 +1,6 @@ package scalariform.formatter -import scalariform.lexer.Tokens._ import scalariform.lexer._ -import scalariform.parser._ -import scalariform.utils._ object FormatResult { diff --git a/scalariform/src/main/scala/scalariform/formatter/FormatterDirectiveParser.scala b/scalariform/src/main/scala/scalariform/formatter/FormatterDirectiveParser.scala index 3239be19..60c3e75f 100644 --- a/scalariform/src/main/scala/scalariform/formatter/FormatterDirectiveParser.scala +++ b/scalariform/src/main/scala/scalariform/formatter/FormatterDirectiveParser.scala @@ -1,5 +1,4 @@ package scalariform.formatter -import scala.util.parsing.input._ import scala.util.parsing.combinator._ class FormatterDirectiveParser extends JavaTokenParsers { diff --git a/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala index 8851853a..5f924f1d 100644 --- a/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala @@ -3,9 +3,7 @@ package scalariform.formatter import scalariform.lexer.Tokens._ import scalariform.lexer._ import scalariform.parser._ -import scalariform.utils.Utils._ import scalariform.utils._ -import scalariform.utils.BooleanLang._ import scalariform.formatter.preferences._ import PartialFunction._ import scalariform.ScalaVersions diff --git a/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala index abecd6ec..11e52b0e 100644 --- a/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala @@ -1,10 +1,8 @@ package scalariform.formatter -import scalariform.lexer.Tokens._ import scalariform.lexer.Token import scalariform.parser._ -import scalariform.utils._ import scalariform.formatter.preferences._ trait TemplateFormatter { self: HasFormattingPreferences with AnnotationFormatter with HasHiddenTokenInfo with TypeFormatter with ExprFormatter with ScalaFormatter ⇒ diff --git a/scalariform/src/main/scala/scalariform/formatter/TypeFormatter.scala b/scalariform/src/main/scala/scalariform/formatter/TypeFormatter.scala index f51b0945..a047692d 100644 --- a/scalariform/src/main/scala/scalariform/formatter/TypeFormatter.scala +++ b/scalariform/src/main/scala/scalariform/formatter/TypeFormatter.scala @@ -1,6 +1,5 @@ package scalariform.formatter -import scalariform.lexer.Tokens._ import scalariform.lexer.Token import scalariform.parser._ import scalariform.utils._ @@ -35,7 +34,7 @@ trait TypeFormatter { self: HasFormattingPreferences with AnnotationFormatter wi formatResult = formatResult.before(element.firstToken, instruction) } // else if (previousElement.isInstanceOf[CallByNameTypeElement]) - // formatResult = formatResult.before(element.firstToken, Compact) + // formatResult = formatResult.before(element.firstToken, Compact) formatResult ++= format(element) } formatResult @@ -61,4 +60,3 @@ trait TypeFormatter { self: HasFormattingPreferences with AnnotationFormatter wi } } - diff --git a/scalariform/src/main/scala/scalariform/lexer/HiddenTokens.scala b/scalariform/src/main/scala/scalariform/lexer/HiddenTokens.scala index c31cb6b8..0a479485 100644 --- a/scalariform/src/main/scala/scalariform/lexer/HiddenTokens.scala +++ b/scalariform/src/main/scala/scalariform/lexer/HiddenTokens.scala @@ -1,6 +1,5 @@ package scalariform.lexer -import scalariform.lexer.Tokens._ import scalariform.utils.Utils object NoHiddenTokens extends HiddenTokens(Nil) diff --git a/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala index d4491139..70313f65 100644 --- a/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/ScalaLexer.scala @@ -1,7 +1,6 @@ package scalariform.lexer import java.io.File -import scala.annotation._ import scala.collection.mutable.{ Queue, ListBuffer } import scala.io.Source import scala.math.min diff --git a/scalariform/src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala b/scalariform/src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala index 7e717bda..6f07318b 100644 --- a/scalariform/src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/ScalaOnlyLexer.scala @@ -3,7 +3,6 @@ package scalariform.lexer import scala.annotation._ import scalariform.lexer.CharConstants.SU import scalariform.lexer.Chars._ -import scalariform.lexer.ScalaLexer._ import scalariform.lexer.Tokens._ import scalariform.utils.Utils import scalariform._ diff --git a/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala b/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala index 8d36e704..8a63447d 100644 --- a/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/XmlLexer.scala @@ -2,9 +2,7 @@ package scalariform.lexer import scala.annotation._ import scalariform.lexer.CharConstants.SU -import scalariform.lexer.ScalaLexer._ import scalariform.lexer.Tokens._ -import scalariform.utils.Utils import scala.PartialFunction.cond /** diff --git a/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala index 7b73b195..e70b2b51 100644 --- a/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala @@ -2,7 +2,6 @@ package scalariform.parser import scalariform.lexer.Tokens._ import scalariform.lexer._ -import scalariform.utils.Utils._ import scala.collection.mutable.ListBuffer import PartialFunction._ From 70e9494d56682ba07de0a11cfb94782530fa0b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 15:52:30 +0100 Subject: [PATCH 18/32] Remove unused and broken method One can't use isInstanceOf with a generic argument. --- scalariform/src/main/scala/scalariform/utils/Utils.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/scalariform/src/main/scala/scalariform/utils/Utils.scala b/scalariform/src/main/scala/scalariform/utils/Utils.scala index 4f796857..e6597ca5 100644 --- a/scalariform/src/main/scala/scalariform/utils/Utils.scala +++ b/scalariform/src/main/scala/scalariform/utils/Utils.scala @@ -8,8 +8,6 @@ object Utils { def when[T](b: Boolean)(x: ⇒ T): Option[T] = if (b) Some(x) else None - def asInstanceOf[T](o: Any) = if (o.isInstanceOf[T]) Some(o.asInstanceOf[T]) else None - def checkNotNull[T](item: T): T = { require(item != null); item } implicit def boolean2ImpliesWrapper(b: Boolean): ImpliesWrapper = new ImpliesWrapper(b) @@ -145,4 +143,3 @@ object Utils { text.take(range.offset) + replacement + text.drop(range.offset + range.length) } - From 3d6b0be9840aa7e6ed08d9da0638fe1bd7e2388c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 15:59:28 +0100 Subject: [PATCH 19/32] Remove more unused definitions --- .../src/main/scala/scalariform/lexer/ModeStack.scala | 2 -- .../scala/scalariform/lexer/NewlineInferencer.scala | 2 -- .../parser/InferredSemicolonScalaParser.scala | 6 ++---- .../main/scala/scalariform/parser/ScalaParser.scala | 12 ++---------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala b/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala index 5fead363..02ee5576 100644 --- a/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala +++ b/scalariform/src/main/scala/scalariform/lexer/ModeStack.scala @@ -9,8 +9,6 @@ trait ModeStack { self: ScalaLexer ⇒ private val modeStack = new Stack[LexerMode] - private var currentRegionStart: Int = 0 - modeStack.push(new ScalaMode) protected def popMode() { diff --git a/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala b/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala index afc969ed..9bf84465 100644 --- a/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala +++ b/scalariform/src/main/scala/scalariform/lexer/NewlineInferencer.scala @@ -140,6 +140,4 @@ object NewlineInferencer { ARROW, LARROW, RARROW, SUBTYPE, VIEWBOUND, SUPERTYPE, HASH, LBRACKET, RPAREN, RBRACKET, RBRACE ) - private val BLANK_LINE_PATTERN = """(?s).*\n\s*\n.*""" - } diff --git a/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala index e70b2b51..adc51100 100644 --- a/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/InferredSemicolonScalaParser.scala @@ -1543,15 +1543,13 @@ class InferredSemicolonScalaParser(tokens: Array[Token]) { private def xmlLiteralPattern() = xml(isPattern = true) - private var tokensArray: Array[Token] = tokens.toArray - private var pos = 0 private def currentToken: Token = this(pos) private def apply(pos: Int): Token = - if (pos < tokensArray.length) - tokensArray(pos) + if (pos < tokens.length) + tokens(pos) else tokens.last diff --git a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala index 5fc8c278..84af8fea 100644 --- a/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala +++ b/scalariform/src/main/scala/scalariform/parser/ScalaParser.scala @@ -491,12 +491,6 @@ class ScalaParser(tokens: Array[Token]) { typeBounds() } - private def equalsExpr() = { - val equalsToken = accept(EQUALS) - val expr_ = expr() - (equalsToken, expr_) - } - private def condExpr(): CondExpr = { if (LPAREN) { val lparen = nextToken() @@ -1911,15 +1905,13 @@ class ScalaParser(tokens: Array[Token]) { private def xmlLiteralPattern() = xml(isPattern = true) - private var tokensArray: Array[Token] = tokens.toArray - private var pos = 0 private def currentToken: Token = this(pos) private def apply(pos: Int): Token = - if (pos < tokensArray.length) - tokensArray(pos) + if (pos < tokens.length) + tokens(pos) else tokens.last From b50043036bf52fcc7a569fec9be31d8b036393b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:01:21 +0100 Subject: [PATCH 20/32] Add cache files to gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2cbfbd42..6181603d 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ nohup.out .settings .classpath .project +.cache* From 6824978b08946485fc9b8c891e4da840d0127f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:01:43 +0100 Subject: [PATCH 21/32] Remove warnings about automatic insertion of parens in test project --- .../test/scala/scalariform/utils/TrimmedTest.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scalariform/src/test/scala/scalariform/utils/TrimmedTest.scala b/scalariform/src/test/scala/scalariform/utils/TrimmedTest.scala index cfae758b..a744b323 100644 --- a/scalariform/src/test/scala/scalariform/utils/TrimmedTest.scala +++ b/scalariform/src/test/scala/scalariform/utils/TrimmedTest.scala @@ -8,12 +8,12 @@ class TrimmedTest extends FlatSpec with ShouldMatchers { it should "just work" in { - Trimmed.unapply("").get should equal ("", "", "") - Trimmed.unapply("foo").get should equal ("", "foo", "") - Trimmed.unapply(" foo").get should equal (" ", "foo", "") - Trimmed.unapply(" foo ").get should equal (" ", "foo", " ") - Trimmed.unapply(" foo bar ").get should equal (" ", "foo bar", " ") - Trimmed.unapply(" ").get should equal (" ", "", "") + Trimmed.unapply("").get should equal (("", "", "")) + Trimmed.unapply("foo").get should equal (("", "foo", "")) + Trimmed.unapply(" foo").get should equal ((" ", "foo", "")) + Trimmed.unapply(" foo ").get should equal ((" ", "foo", " ")) + Trimmed.unapply(" foo bar ").get should equal ((" ", "foo bar", " ")) + Trimmed.unapply(" ").get should equal ((" ", "", "")) } From 77a96e41a64cd59de555183299381a769c466991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:12:28 +0100 Subject: [PATCH 22/32] Remove unused imports in test project This contains also a lot of whitespace changes. Should have thought about them earlier, then I could have committed them in a different commit. --- .../formatter/AbstractFormatterTest.scala | 3 - .../formatter/BlockExprFormatterTest.scala | 13 ++-- .../formatter/CaseClausesFormatterTest.scala | 5 -- .../formatter/CommentFormatterTest.scala | 29 +++++---- .../CompactControlReadabilityTest.scala | 11 +--- .../formatter/DefOrDclFormatterTest.scala | 17 ++--- .../formatter/ForExprFormatterTest.scala | 23 +++---- .../formatter/IfExprFormatterTest.scala | 63 +++++++++---------- .../formatter/ImportFormatterTest.scala | 3 +- .../formatter/IndentWithTabsTest.scala | 3 +- .../MiscExpressionFormatterTest.scala | 12 +--- .../formatter/PackageFormatterTest.scala | 5 +- .../formatter/RewriteArrowsTest.scala | 4 +- .../formatter/ScriptFormatterTest.scala | 3 +- .../StringInterpolationFormatterTest.scala | 22 +++---- .../formatter/TemplateFormatterTest.scala | 6 +- .../formatter/TryExprFormatterTest.scala | 31 +++++---- .../formatter/WhileExprFormatterTest.scala | 17 ++--- .../XmlExpressionFormatterTest.scala | 23 +++---- .../lexer/NewlineInferencerTest.scala | 6 +- .../RedundantSemicolonDetectorTest.scala | 13 ++-- .../scalariform/lexer/ScalaLexerTest.scala | 9 +-- .../scala/scalariform/parser/ParserTest.scala | 1 - .../scalariform/parser/ScalaParserTest.scala | 1 - 24 files changed, 122 insertions(+), 201 deletions(-) diff --git a/scalariform/src/test/scala/scalariform/formatter/AbstractFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/AbstractFormatterTest.scala index b680a590..109f6dde 100644 --- a/scalariform/src/test/scala/scalariform/formatter/AbstractFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/AbstractFormatterTest.scala @@ -1,10 +1,7 @@ package scalariform.formatter -import scalariform.parser._ import scalariform.lexer._ import scalariform.formatter.preferences._ -import scala.util.parsing.input._ -import scala.util.parsing.combinator._ import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers import org.scalatest.TestFailedException diff --git a/scalariform/src/test/scala/scalariform/formatter/BlockExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/BlockExprFormatterTest.scala index f3527907..18855203 100644 --- a/scalariform/src/test/scala/scalariform/formatter/BlockExprFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/BlockExprFormatterTest.scala @@ -1,14 +1,11 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ - // format: OFF class BlockExprFormatterTest extends AbstractExpressionFormatterTest { override val debug = false - """{ + """{ | a(); | b() |}""" ==> @@ -33,7 +30,7 @@ class BlockExprFormatterTest extends AbstractExpressionFormatterTest { |}""" """{ - |val x = { + |val x = { |a() |b() |} @@ -58,7 +55,7 @@ class BlockExprFormatterTest extends AbstractExpressionFormatterTest { "{ class A }" ==> "{ class A }" - """{ + """{ |class A |class B |}""" ==> @@ -66,7 +63,7 @@ class BlockExprFormatterTest extends AbstractExpressionFormatterTest { | class A | class B |}""" - + "{ case 42 => }" ==> "{ case 42 => }" "{ case -42 => }" ==> "{ case -42 => }" @@ -78,7 +75,7 @@ class BlockExprFormatterTest extends AbstractExpressionFormatterTest { | println("foo") | (x: Int) => 42 |}""" - + """{ |c ! |val b diff --git a/scalariform/src/test/scala/scalariform/formatter/CaseClausesFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/CaseClausesFormatterTest.scala index 6f7e6dbd..f59fa5c7 100644 --- a/scalariform/src/test/scala/scalariform/formatter/CaseClausesFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/CaseClausesFormatterTest.scala @@ -1,7 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -244,7 +242,6 @@ class CaseClausesFormatterTest extends AbstractExpressionFormatterTest { | case Cell[a](x: Int) => c.x = 5 |}""" - { implicit val formattingPreferences = FormattingPreferences.setPreference(AlignSingleLineCaseStatements, true).setPreference(RewriteArrowSymbols, true) @@ -298,7 +295,6 @@ class CaseClausesFormatterTest extends AbstractExpressionFormatterTest { | } |}""" - "{ case a ::(b) ⇒ }" ==> "{ case a :: (b) ⇒ }" @@ -315,7 +311,6 @@ class CaseClausesFormatterTest extends AbstractExpressionFormatterTest { | } |}""" - { implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesWithinPatternBinders, false) diff --git a/scalariform/src/test/scala/scalariform/formatter/CommentFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/CommentFormatterTest.scala index a0838b02..ba0cad0e 100644 --- a/scalariform/src/test/scala/scalariform/formatter/CommentFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/CommentFormatterTest.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -10,12 +9,12 @@ class CommentFormatterTest extends AbstractFormatterTest { type Result = CompilationUnit def parse(parser: ScalaParser) = parser.scriptBody() - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState()) override val debug = false - """/** + """/** |*a |b | */c""" ==> @@ -25,7 +24,7 @@ class CommentFormatterTest extends AbstractFormatterTest { | */ |c""" - """/** + """/** |*a |b | */""" ==> @@ -37,7 +36,7 @@ class CommentFormatterTest extends AbstractFormatterTest { """/** | * - | *Wibble*/ + | *Wibble*/ |class X""" ==> """/** | * @@ -88,7 +87,7 @@ class CommentFormatterTest extends AbstractFormatterTest { | * b | */ |""" - + // nested comments """/** |/* @@ -99,17 +98,17 @@ class CommentFormatterTest extends AbstractFormatterTest { | * */ | */ |""" - + { implicit val formattingPreferences = FormattingPreferences.setPreference(MultilineScaladocCommentsStartOnFirstLine, true) - """/** This method applies f to each + """/** This method applies f to each | * element of the given list. | */""" ==> """/** This method applies f to each | * element of the given list. | */ - |""" + |""" """/** Foo |Bar @@ -132,18 +131,18 @@ class CommentFormatterTest extends AbstractFormatterTest { | */ |""" } - + { implicit val formattingPreferences = FormattingPreferences.setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, true) - """/** This method applies f to each + """/** This method applies f to each | * element of the given list. | */""" ==> """/** | * This method applies f to each | * element of the given list. | */ - |""" + |""" """/** Foo |Bar @@ -168,18 +167,18 @@ class CommentFormatterTest extends AbstractFormatterTest { | */ |""" } - + { implicit val formattingPreferences = FormattingPreferences .setPreference(MultilineScaladocCommentsStartOnFirstLine, true) .setPreference(PlaceScaladocAsterisksBeneathSecondAsterisk, true) - """/** This method applies f to each + """/** This method applies f to each | * element of the given list. | */""" ==> """/** This method applies f to each | * element of the given list. | */ - |""" + |""" """/** Foo |Bar diff --git a/scalariform/src/test/scala/scalariform/formatter/CompactControlReadabilityTest.scala b/scalariform/src/test/scala/scalariform/formatter/CompactControlReadabilityTest.scala index 45727817..20ea842b 100644 --- a/scalariform/src/test/scala/scalariform/formatter/CompactControlReadabilityTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/CompactControlReadabilityTest.scala @@ -1,15 +1,12 @@ package scalariform.formatter -import preferences.FormattingPreferences._ import scalariform.formatter.preferences._ -import scalariform.parser._ -import scalariform.formatter._ // format: OFF class CompactControlReadabilityTest extends AbstractExpressionFormatterTest { implicit val formattingPreferences = FormattingPreferences.setPreference(CompactControlReadability, true) - + """if(a){ |foo |} else { @@ -98,9 +95,7 @@ class CompactControlReadabilityTest extends AbstractExpressionFormatterTest { |}""" "if (y > 0) positive else if (y < 0) negative else zero" ==> "if (y > 0) positive else if (y < 0) negative else zero" - - "try x catch y finally z" ==> "try x catch y finally z" - - + "try x catch y finally z" ==> "try x catch y finally z" + } diff --git a/scalariform/src/test/scala/scalariform/formatter/DefOrDclFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/DefOrDclFormatterTest.scala index fb2d8501..a700f0e6 100644 --- a/scalariform/src/test/scala/scalariform/formatter/DefOrDclFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/DefOrDclFormatterTest.scala @@ -2,7 +2,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -21,7 +20,7 @@ class DefOrDclFormatterTest extends AbstractFormatterTest { "def foo={doStuff()}" ==> "def foo = { doStuff() }" "def foo ()" ==> "def foo()" - + "def foo(n:Int)" ==> "def foo(n: Int)" "def foo( n:Int,m:String )" ==> "def foo(n: Int, m: String)" @@ -31,7 +30,7 @@ class DefOrDclFormatterTest extends AbstractFormatterTest { "def modN ( n :Int ) (x: Int) = ((x % n) == 0)" ==> "def modN(n: Int)(x: Int) = ((x % n) == 0)" "def foo(a: Int=123+2, b: Int=456+7)" ==> "def foo(a: Int = 123 + 2, b: Int = 456 + 7)" - + "def foo[X<%T1,Y<:T2,Z>:T3]()" ==> "def foo[X <% T1, Y <: T2, Z >: T3]()" "def foo(x: =>Int, y: Int *)" ==> "def foo(x: => Int, y: Int*)" @@ -54,7 +53,7 @@ class DefOrDclFormatterTest extends AbstractFormatterTest { """def foo = | if (true) - | 1 + | 1 | else | 2""" ==> """def foo = @@ -106,7 +105,7 @@ class DefOrDclFormatterTest extends AbstractFormatterTest { { - implicit val formattingPreferences = + implicit val formattingPreferences = FormattingPreferences .setPreference(IndentLocalDefs, true) @@ -114,7 +113,7 @@ class DefOrDclFormatterTest extends AbstractFormatterTest { | def b() = { | def c() = 42 | println("d") - | def e() = + | def e() = | 42 |println("f") | def g() { @@ -271,14 +270,10 @@ class DefOrDclFormatterTest extends AbstractFormatterTest { """def test(test: ^^ *)""" ==> """def test(test: ^^ *)""" - def parse(parser: ScalaParser) = parser.nonLocalDefOrDcl() type Result = FullDefOrDcl - - def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState(indentLevel = 0)) + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState(indentLevel = 0)) } - - diff --git a/scalariform/src/test/scala/scalariform/formatter/ForExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/ForExprFormatterTest.scala index 44092fdd..5cea184d 100644 --- a/scalariform/src/test/scala/scalariform/formatter/ForExprFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/ForExprFormatterTest.scala @@ -1,8 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ - // format: OFF class ForExprFormatterTest extends AbstractExpressionFormatterTest { @@ -35,7 +32,7 @@ class ForExprFormatterTest extends AbstractExpressionFormatterTest { "for (x <- xs) a()" ==> "for (x <- xs) a()" - """for (x <- xs) + """for (x <- xs) |a()""" ==> """for (x <- xs) | a()""" @@ -51,12 +48,12 @@ class ForExprFormatterTest extends AbstractExpressionFormatterTest { """for(x <- xs) { a() }""" ==> """for (x <- xs) { a() }""" - """for(x <- xs) + """for(x <- xs) |{ a() }""" ==> """for (x <- xs) { a() }""" """for(x <- xs) yield - |{ + |{ | a + b |}""" ==> """for (x <- xs) yield { @@ -76,7 +73,7 @@ class ForExprFormatterTest extends AbstractExpressionFormatterTest { """for(x <- xs) |yield - |{ + |{ |z } """ ==> """for (x <- xs) yield { | z @@ -110,10 +107,10 @@ class ForExprFormatterTest extends AbstractExpressionFormatterTest { | val z = x + y |) yield z""" - """for { + """for { |x <- xs |y <- ys - |} + |} |yield |2""" ==> """for { @@ -121,10 +118,10 @@ class ForExprFormatterTest extends AbstractExpressionFormatterTest { | y <- ys |} yield 2""" - """for { + """for { |x <- xs |y <- ys - |} + |} |println(x + y)""" ==> """for { | x <- xs @@ -150,7 +147,5 @@ class ForExprFormatterTest extends AbstractExpressionFormatterTest { | for (n <- 1 to 10) | proc() |)""" - -} - +} diff --git a/scalariform/src/test/scala/scalariform/formatter/IfExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/IfExprFormatterTest.scala index dc04a9df..dbe37f86 100644 --- a/scalariform/src/test/scala/scalariform/formatter/IfExprFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/IfExprFormatterTest.scala @@ -1,14 +1,11 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ - // format: OFF class IfExprFormatterTest extends AbstractExpressionFormatterTest { "if(x>y)(x)else(y)" ==> "if (x > y) (x) else (y)" - "if (true) 3 else 4" ==> "if (true) 3 else 4" + "if (true) 3 else 4" ==> "if (true) 3 else 4" """if (true) |println("Hello world")""" ==> @@ -40,7 +37,7 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { |else if (1 == 2) | println("wobble") |else - | println("wobble")""" + | println("wobble")""" """if (1 == 1) println("wibble") | else println("wobble")""" ==> @@ -52,14 +49,14 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { "if(x>y){x}else{y}" ==> "if (x > y) { x } else { y }" """if (x > y) { - |println("Foo") }""" ==> + |println("Foo") }""" ==> """if (x > y) { | println("Foo") |}""" - + """if (x > y) { - |println("Foo") } else { - |println("Bar") }""" ==> + |println("Foo") } else { + |println("Bar") }""" ==> """if (x > y) { | println("Foo") |} else { @@ -68,13 +65,12 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { """if (x > y) { |println("Foo") - |println("Bar")}""" ==> + |println("Bar")}""" ==> """if (x > y) { | println("Foo") | println("Bar") |}""" - """if (1 == 2) { |println("bob") |println("bob") @@ -125,8 +121,8 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { |}""" """if (true) { - | println("wobble") } - |else { + | println("wobble") } + |else { |println("wobble") }""" ==> """if (true) { | println("wobble") @@ -147,14 +143,14 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { """if (1 == 2) {println("wibble");println("wobble")}""" ==> """if (1 == 2) { println("wibble"); println("wobble") }""" - """if (true) + """if (true) |{ x }""" ==> """if (true) { x }""" """if (a) - |if (b) - |x - |else + |if (b) + |x + |else |y""" ==> """if (a) | if (b) @@ -181,29 +177,29 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { | 2 |}""" - """if (true) 1 else + """if (true) 1 else |{ 2 } """ ==> """if (true) 1 else { 2 }""" - """if (true) { 1 + """if (true) { 1 |} |else 2""" ==> """if (true) { | 1 |} else 2""" - """if (true) 1 else - |{ + """if (true) 1 else + |{ |2 }""" ==> """if (true) 1 else { | 2 |}""" - """if (true) { - | 1 + """if (true) { + | 1 |} + 2 | else { - |2 + |2 |} + 2""" ==> """if (true) { | 1 @@ -276,7 +272,7 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { """if (b) | c | { d } - |else + |else | e""" ==> """if (b) | c { d } @@ -298,9 +294,9 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { """if (a) { println() } |else { println() }""" - """Some(if (a) - |b - |else + """Some(if (a) + |b + |else |c)""" ==> """Some(if (a) | b @@ -308,27 +304,27 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { | c)""" """Some(if (a) { - |b - |} else + |b + |} else |c)""" ==> """Some(if (a) { | b |} else | c)""" - """Some(if (a) { b } else + """Some(if (a) { b } else |c)""" ==> """Some(if (a) { b } else | c)""" - """if (cond) + """if (cond) |42 else | 42""" ==> """if (cond) | 42 |else | 42""" - + """if (a) |b else { |c @@ -351,4 +347,3 @@ class IfExprFormatterTest extends AbstractExpressionFormatterTest { override val debug = false } - diff --git a/scalariform/src/test/scala/scalariform/formatter/ImportFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/ImportFormatterTest.scala index 1651e740..46e56a8b 100644 --- a/scalariform/src/test/scala/scalariform/formatter/ImportFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/ImportFormatterTest.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences.{SpacesAroundMultiImports, FormattingPreferences} // format: OFF @@ -44,7 +43,7 @@ class ImportFormatterTest extends AbstractFormatterTest { type Result = CompilationUnit def parse(parser: ScalaParser) = parser.compilationUnit() - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState()) } diff --git a/scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala b/scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala index ef464874..6c4579a4 100644 --- a/scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/IndentWithTabsTest.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -173,7 +172,7 @@ class IndentWithTabsTest extends AbstractFormatterTest { type Result = CompilationUnit def parse(parser: ScalaParser) = parser.compilationUnitOrScript - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState()) } diff --git a/scalariform/src/test/scala/scalariform/formatter/MiscExpressionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/MiscExpressionFormatterTest.scala index 27f22e93..c3bb3a00 100644 --- a/scalariform/src/test/scala/scalariform/formatter/MiscExpressionFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/MiscExpressionFormatterTest.scala @@ -1,7 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -79,7 +77,7 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { """a( |)""" ==> """a()""" - + "_ => 3" ==> "_ => 3" "(_: Int) => 3" ==> "(_: Int) => 3" "(x: String, y: Map[String, String]) => y(x)" ==> "(x: String, y: Map[String, String]) => y(x)" @@ -98,7 +96,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { | def m: Int |}""" - """List[Int { val n: Int |val m: Int }]()""" ==> """List[Int { @@ -106,7 +103,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { | val m: Int |}]()""" - """42 match { |case x: Int { val n: Int |val m: Int } => 42 @@ -251,7 +247,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { |{foo}""" ==> """println { foo }""" - """doBlock(xs) {(x:Int) => println(x) |println("bobble") |}""" ==> @@ -451,7 +446,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { | b |)""" - """Book( | name = "Name", | author = "Author", @@ -493,7 +487,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { | d |)""" - """(a -> |new B)""" ==> """(a -> @@ -523,7 +516,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { "a: ::" ==> "a: ::" - """(a | + b |+ c)""" ==> @@ -766,7 +758,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { | ) | .d""" - "Foo.this" ==> "Foo.this" """List.range(1, r) flatMap ( @@ -808,7 +799,6 @@ class MiscExpressionFormatterTest extends AbstractExpressionFormatterTest { "{ val P(a, b*c) = p }" ==> "{ val P(a, b * c) = p }" - """new {} with A(new { |val x = 42}) with B(new { |val x = 42})""" ==> diff --git a/scalariform/src/test/scala/scalariform/formatter/PackageFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/PackageFormatterTest.scala index ae340c07..d0353b20 100644 --- a/scalariform/src/test/scala/scalariform/formatter/PackageFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/PackageFormatterTest.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -12,7 +11,7 @@ class PackageFormatterTest extends AbstractFormatterTest { type Result = CompilationUnit def parse(parser: ScalaParser) = parser.compilationUnit() - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState()) "" ==> "" @@ -37,7 +36,7 @@ class PackageFormatterTest extends AbstractFormatterTest { """/* foo */ |package wibble""" - """package a + """package a |{}""" ==> """package a {}""" diff --git a/scalariform/src/test/scala/scalariform/formatter/RewriteArrowsTest.scala b/scalariform/src/test/scala/scalariform/formatter/RewriteArrowsTest.scala index edf22b86..f62cb8ef 100644 --- a/scalariform/src/test/scala/scalariform/formatter/RewriteArrowsTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/RewriteArrowsTest.scala @@ -1,7 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -16,5 +14,5 @@ class RewriteArrowsTest extends AbstractExpressionFormatterTest { } override val debug = false - + } diff --git a/scalariform/src/test/scala/scalariform/formatter/ScriptFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/ScriptFormatterTest.scala index b261e84e..9de0fb0f 100644 --- a/scalariform/src/test/scala/scalariform/formatter/ScriptFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/ScriptFormatterTest.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ // format: OFF class ScriptFormatterTest extends AbstractFormatterTest { @@ -19,7 +18,7 @@ class ScriptFormatterTest extends AbstractFormatterTest { type Result = CompilationUnit def parse(parser: ScalaParser) = parser.scriptBody() - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState()) } diff --git a/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala index 368251bb..a4b790bd 100644 --- a/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala @@ -1,21 +1,17 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ -import scalariform.formatter.preferences._ - // format: OFF class StringInterpolationFormatterTest extends AbstractExpressionFormatterTest { - + implicit val scalaVersion: String = "2.10.0" - - s"foo".text ==> s"foo".text + + s"foo".text ==> s"foo".text s"".text ==> s"".text s"my name is $name".text ==> s"my name is $name".text s"my name is $this".text ==> s"my name is $this".text - """s"my name is ${bob}"""" ==> """s"my name is ${bob}"""" - """s"my name is ${ person.name }"""" ==> """s"my name is ${person.name}"""" - + """s"my name is ${bob}"""" ==> """s"my name is ${bob}"""" + """s"my name is ${ person.name }"""" ==> """s"my name is ${person.name}"""" + """s"my name is ${ |bob}"""" ==> """s"my name is ${ @@ -30,10 +26,10 @@ class StringInterpolationFormatterTest extends AbstractExpressionFormatterTest { | person.getName |}"""" - s"""foo""".text ==> s"""foo""".text + s"""foo""".text ==> s"""foo""".text s"""""".text ==> s"""""".text s"""my name is $name""".text ==> s"""my name is $name""".text - "s\"\"\"my name is ${bob}\"\"\"" ==> "s\"\"\"my name is ${bob}\"\"\"" - "s\"\"\"my name is ${ person.name }\"\"\"" ==> "s\"\"\"my name is ${person.name}\"\"\"" + "s\"\"\"my name is ${bob}\"\"\"" ==> "s\"\"\"my name is ${bob}\"\"\"" + "s\"\"\"my name is ${ person.name }\"\"\"" ==> "s\"\"\"my name is ${person.name}\"\"\"" } diff --git a/scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala index 1e2f6dce..570e2a82 100644 --- a/scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala @@ -1,7 +1,6 @@ package scalariform.formatter import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -63,7 +62,6 @@ class TemplateFormatterTest extends AbstractFormatterTest { |@B(c = "d")/*c*/ |abstract class/*d*/E/*e*/[F]/*f*/@G()/*g*/private/*h*/(val h: I)/*i*/(implicit j: K)/*j*/extends/*k*/{} with/*l*/L(2) with M/*m*/{}""" because "sort out what we want" - { implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesWithinPatternBinders, true) @@ -421,7 +419,7 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW | entries: Seq[A] = Nil, | initial: A |): Option[A]""" - + // Formats function types correctly """private def executeWithinClient[T]( |crawlerConfig: String => JsValue = Fancy.function, @@ -450,7 +448,6 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW | simpleType: String = "" |): B""" - // Param gets placed onto a new line due to current limitations of existing IntertokenFormatInstructions """case class Spacing(param: Int = 1, |paramTwo: Int = 2, @@ -770,7 +767,6 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW |()""" ==> """class A @B() ()""" - // See Scala trac #3672 for next two cases: """object test { diff --git a/scalariform/src/test/scala/scalariform/formatter/TryExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/TryExprFormatterTest.scala index 5ba9736f..57e5185d 100644 --- a/scalariform/src/test/scala/scalariform/formatter/TryExprFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/TryExprFormatterTest.scala @@ -1,8 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ - // format: OFF class TryExprFormatterTest extends AbstractExpressionFormatterTest { @@ -10,12 +7,12 @@ class TryExprFormatterTest extends AbstractExpressionFormatterTest { "try println()" ==> "try println()" - """try + """try |println()""" ==> """try | println()""" - """try + """try | { |println() | }""" ==> @@ -41,21 +38,21 @@ class TryExprFormatterTest extends AbstractExpressionFormatterTest { "try { foo() }catch{ case e => }" ==> "try { foo() } catch { case e => }" - """try { foo() } + """try { foo() } |catch{ case e => }""" ==> """try { foo() } |catch { case e => }""" - """try { - |foo() } + """try { + |foo() } |catch{ case e => }""" ==> """try { | foo() |} catch { case e => }""" """try { - |} catch { case e => }finally - |{ + |} catch { case e => }finally + |{ |println("foo") }""" ==> """try { |} catch { case e => } finally { @@ -64,14 +61,14 @@ class TryExprFormatterTest extends AbstractExpressionFormatterTest { "try {} catch { case e => } finally {}" ==> "try {} catch { case e => } finally {}" - """try {} - |catch { case e => } + """try {} + |catch { case e => } |finally {}""" ==> """try {} |catch { case e => } |finally {}""" - """try {} catch { case e => } + """try {} catch { case e => } |finally{ |resource.close() |}""" ==> @@ -80,15 +77,15 @@ class TryExprFormatterTest extends AbstractExpressionFormatterTest { | resource.close() |}""" - """try {} catch { case e => } + """try {} catch { case e => } |finally resource.close()""" ==> """try {} catch { case e => } |finally resource.close()""" - """try + """try |resource.useIt() - |catch { case e => } - |finally + |catch { case e => } + |finally |resource.close()""" ==> """try | resource.useIt() diff --git a/scalariform/src/test/scala/scalariform/formatter/WhileExprFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/WhileExprFormatterTest.scala index d2fc13e3..d5f357de 100644 --- a/scalariform/src/test/scala/scalariform/formatter/WhileExprFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/WhileExprFormatterTest.scala @@ -1,8 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ - // format: OFF class WhileExprFormatterTest extends AbstractExpressionFormatterTest { @@ -15,7 +12,7 @@ class WhileExprFormatterTest extends AbstractExpressionFormatterTest { "while (true) { run() }" ==> "while (true) { run() }" - """while (true) { + """while (true) { |run() }""" ==> """while (true) { | run() @@ -23,7 +20,7 @@ class WhileExprFormatterTest extends AbstractExpressionFormatterTest { "do run()while( true )" ==> "do run() while (true)" - """do + """do |run() while (true)""" ==> """do | run() @@ -55,14 +52,14 @@ class WhileExprFormatterTest extends AbstractExpressionFormatterTest { """do run() |while (true)""" - """do + """do |run() |while (true)""" ==> """do | run() |while (true)""" - """do + """do |run() |; |while (true)""" ==> @@ -82,7 +79,7 @@ class WhileExprFormatterTest extends AbstractExpressionFormatterTest { """while(true){do { run(); }; |while (if (true) { - |a} else { + |a} else { |b}) |}""" ==> """while (true) { @@ -94,11 +91,9 @@ class WhileExprFormatterTest extends AbstractExpressionFormatterTest { | }) |}""" - """a(while (b) + """a(while (b) |c())""" ==> """a(while (b) | c())""" } - - diff --git a/scalariform/src/test/scala/scalariform/formatter/XmlExpressionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/XmlExpressionFormatterTest.scala index 7bcee88d..4814ec4c 100644 --- a/scalariform/src/test/scala/scalariform/formatter/XmlExpressionFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/XmlExpressionFormatterTest.scala @@ -1,7 +1,5 @@ package scalariform.formatter -import scalariform.parser._ -import scalariform.formatter._ import scalariform.formatter.preferences._ // format: OFF @@ -17,10 +15,10 @@ class XmlExpressionFormatterTest extends AbstractExpressionFormatterTest { "1" ==> "1" " 1 " ==> " 1 " - " b {c} d {e} f " ==> " b { c } d { e } f " + " b {c} d {e} f " ==> " b { c } d { e } f " "ABORT: { msg }" ==> "ABORT: { msg }" // See issue #27 " {b} " ==> " { b } " - + """ |{foo} |""" ==> @@ -45,14 +43,14 @@ class XmlExpressionFormatterTest extends AbstractExpressionFormatterTest { | 42 |""" - """b()""" ==> """b()""" - """b()""" ==> """b( |}""" - + """{ | | { name.get } | { version.get } - |}""" ==> + |}""" ==> """{ | | { name.get } @@ -123,7 +121,6 @@ class XmlExpressionFormatterTest extends AbstractExpressionFormatterTest { | |}""" - """{ |{ } | { @@ -201,7 +198,7 @@ class XmlExpressionFormatterTest extends AbstractExpressionFormatterTest { """{ | - |val x = + |val x = | | | @@ -242,7 +239,7 @@ class XmlExpressionFormatterTest extends AbstractExpressionFormatterTest { | => | |}""" - + { implicit val formattingPreferences = FormattingPreferences.setPreference(FormatXml, false) @@ -267,9 +264,9 @@ class XmlExpressionFormatterTest extends AbstractExpressionFormatterTest { } "{
}" ==> "{
}" - + "a match { case {_*} => }" ==> "a match { case { _* } => }" - + override val debug = false } diff --git a/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala b/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala index 6455dced..a5c4122e 100644 --- a/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala +++ b/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala @@ -4,9 +4,6 @@ import scalariform._ import scalariform.lexer.Tokens._ import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers -import org.scalatest.TestFailedException -import org.scalatest.TestPendingException -import java.io._ /** * Test full tokeniser, including newline inferencing. @@ -18,7 +15,7 @@ class NewlineInferencerTest extends FlatSpec with ShouldMatchers { // See issue #60 """ - a match { + a match { case b => val c = d case e => @@ -49,4 +46,3 @@ class NewlineInferencerTest extends FlatSpec with ShouldMatchers { } } - diff --git a/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala b/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala index 1c886773..99a9434e 100644 --- a/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala +++ b/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala @@ -1,11 +1,8 @@ package scalariform.lexer import scalariform._ -import scalariform.lexer.Tokens._ import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers -import org.scalatest.TestFailedException -import org.scalatest.TestPendingException import scalariform.utils.Utils._ class RedundantSemicolonDetectorTest extends FlatSpec with ShouldMatchers { @@ -14,22 +11,22 @@ class RedundantSemicolonDetectorTest extends FlatSpec with ShouldMatchers { new { def check() = checkSemis(s, scalaVersion) }; // Expected redundant semicolons are indicated with <;> """ - class A { + class A { def foo = 42<;> - def bar = 123; def baz = 1234 + def bar = 123; def baz = 1234 }<;> """.check(); """ - { + { println("Foo")<;> } """.check(); """ - class A { + class A { for ( - x <- 1 to 10; + x <- 1 to 10; y <- 1 to 10 ) yield x + y<;> } diff --git a/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala b/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala index b9b71928..f8dc477e 100644 --- a/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala +++ b/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala @@ -4,9 +4,6 @@ import scalariform._ import scalariform.lexer.Tokens._ import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers -import org.scalatest.TestFailedException -import org.scalatest.TestPendingException -import java.io._ class ScalaLexerTest extends FlatSpec with ShouldMatchers { @@ -208,7 +205,7 @@ println("foo")""" producesTokens (VARID, LPAREN, STRING_LITERAL, RPAREN, WS, VAR """""" producesTokens (XML_PROCESSING_INSTRUCTION) """ - + """ producesTokens (XML_START_OPEN, XML_NAME, XML_EMPTY_CLOSE, XML_PCDATA, XML_START_OPEN, XML_NAME, XML_EMPTY_CLOSE) """ @@ -220,9 +217,9 @@ println("foo")""" producesTokens (VARID, LPAREN, STRING_LITERAL, RPAREN, WS, VAR "for(<-Nil)Nil" producesTokens (FOR, LPAREN, XML_START_OPEN, XML_NAME, XML_EMPTY_CLOSE, LARROW, VARID, RPAREN, VARID) "a -> b" producesTokens(VARID, WS, RARROW, WS, VARID) - + "a → b" producesTokens(VARID, WS, RARROW, WS, VARID) - + "\"\\u001A\"" producesTokens (STRING_LITERAL) "\"\"\"\\u001A\"\"\"" producesTokens (STRING_LITERAL) diff --git a/scalariform/src/test/scala/scalariform/parser/ParserTest.scala b/scalariform/src/test/scala/scalariform/parser/ParserTest.scala index 3dc967d5..2548afb8 100644 --- a/scalariform/src/test/scala/scalariform/parser/ParserTest.scala +++ b/scalariform/src/test/scala/scalariform/parser/ParserTest.scala @@ -1,7 +1,6 @@ package scalariform.parser import scalariform.lexer._ -import scalariform.parser._ import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers diff --git a/scalariform/src/test/scala/scalariform/parser/ScalaParserTest.scala b/scalariform/src/test/scala/scalariform/parser/ScalaParserTest.scala index cae004a5..8edca6f1 100644 --- a/scalariform/src/test/scala/scalariform/parser/ScalaParserTest.scala +++ b/scalariform/src/test/scala/scalariform/parser/ScalaParserTest.scala @@ -1,7 +1,6 @@ package scalariform.parser import scalariform.lexer._ -import scalariform.parser._ import org.scalatest.FlatSpec import org.scalatest.matchers.ShouldMatchers From a280866e4501d09738c320727077a149bd85cbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:17:52 +0100 Subject: [PATCH 23/32] Remove trailing whitespace All changes are done automatically with: find . -iname "*.scala" -print0 | xargs -0 sed -i 's/ *$//' --- .../scalariform/gui/FormatterFrame.scala | 2 +- .../astselect/AstSelectorTest.scala | 90 +++++++++---------- .../formatter/FunctionFormatterTest.scala | 4 +- .../formatter/TypeFormatterTest.scala | 40 ++++----- 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala b/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala index b1931b66..fc8774fd 100644 --- a/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala +++ b/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala @@ -459,7 +459,7 @@ object Samples { val sample1 = """package foo . bar . baz - | /** + | /** | * Scaladoc comment | * |*/ diff --git a/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala b/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala index bd8a2d4a..9cdadcf4 100644 --- a/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala +++ b/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala @@ -38,8 +38,8 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $ " ~ " $$$$$$$$$ " - " class A(n: Int) " ~ - " $$$$$$ " ~ + " class A(n: Int) " ~ + " $$$$$$ " ~ " $$$$$$$$$$$$$$$ " " foo(42) " ~ @@ -69,7 +69,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " new Wibble " ~ " $$$$$$ " ~ " $$$$$$$$$$ " - + " new Wibble() " ~ " $$$ " ~ " $$$$$$$$$$$$ " @@ -77,11 +77,11 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " a + b + c " ~ " $ " ~ " $$$$$ " ~ - " $$$$$$$$$ " + " $$$$$$$$$ " " a + b + c " ~ " $$$ " ~ - " $$$$$$$$$ " + " $$$$$$$$$ " " x + y * z " ~ " $$$ " ~ @@ -94,17 +94,17 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$$$$$$$$ " ~ " $$$$$$$$$$$$$$$$$$ " - " a :: b :: Nil ++ Nil " ~ - " $$$ " ~ - " $$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$ " ~ + " a :: b :: Nil ++ Nil " ~ + " $$$ " ~ + " $$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$ " ~ " $$$$$$$$$$$$$$$$$$$$ " - " a + b :: b + c :: Nil ++ Nil " ~ - " $ " ~ - " $$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$$$$$$$$$$ " + " a + b :: b + c :: Nil ++ Nil " ~ + " $ " ~ + " $$$$$ " ~ + " $$$$$$$$$$$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$$$$$$$$$$$$$$ " " i += 10 + 2 " ~ " $ " ~ @@ -122,7 +122,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " + " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " " a.foo(b).bar(c) " ~ " $ " ~ @@ -132,7 +132,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " def x = 42 " ~ " $$ " ~ " $$$$$$$$$$ " - + " x: Int " ~ " $ " ~ " $$$$$$ " @@ -166,7 +166,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$ " " for (a <- b if c) {} " ~ - " $ " ~ + " $ " ~ " $$$$$$$$$$$ " " def a { b } " ~ @@ -178,11 +178,11 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$ " ~ " $$$$$$$$$$$ " - " /** a */ class B " ~ + " /** a */ class B " ~ " $ " ~ " $$$$$$$$$$$$$$$$ " - " /** a */ class B " ~ + " /** a */ class B " ~ " $$$$ " ~ " $$$$$$$$ " ~ " $$$$$$$$$$$$$$$$ " @@ -191,7 +191,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$$$$$$$$$$$ " ~ " $$$$$$$$$$$$$$$$$$$$$$$$$ " - " val a = { b } " ~ + " val a = { b } " ~ " $ " ~ " $$$$$ " // A bit inconsistent with def's, but maybe OK @@ -205,13 +205,13 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " def a = b(c) " ~ " $$$ " ~ - " $$$$ " + " $$$$ " " def a = { b } " ~ " $ " ~ " $$$$$ " - " for (a <- b) c(d) " ~ + " for (a <- b) c(d) " ~ " $$$ " ~ " $$$$ " @@ -225,7 +225,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$$$$$$$$$$$$$$$$$$ " " sealed class A " ~ - " $$$ " ~ + " $$$ " ~ " $$$$$$$$$$$$$$ " " protected[a] val b " ~ @@ -233,16 +233,16 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$$$$$$$ " " evaluating { stack.pop() } should produce [NoSuchElementException] " ~ - " $$$$$$$ " ~ - " $$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " + " $$$$$$$ " ~ + " $$$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " " evaluating { stack.pop() } should produce [NoSuchElementException] " ~ - " $$$$$$$$$$$$$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " + " $$$$$$$$$$$$$$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " ~ + " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " " } wibble " ~ " $ " ~ @@ -261,10 +261,10 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$$$$$$$$$$$$$$$$ " " package foo.bar.baz " ~ - " $$$ " ~ + " $$$ " ~ " $$$$$$$ " ~ " $$$$$$$$$$$ " ~ - " $$$$$$$$$$$$$$$$$$$ " + " $$$$$$$$$$$$$$$$$$$ " " foo[bar][baz] " ~ " $$$ " ~ @@ -275,16 +275,16 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { " $$$ " ~ " $$$$ " ~ " $$$$$$ " - - /* TODO: Need AST representation for [] calls + + /* TODO: Need AST representation for [] calls " foo[bar][baz][boz] " ~ " $$$$$$$$ " ~ " $$$$$$$$$$$$$ " */ - + { implicit val scalaVersion = "2.10.0" - + """ s"my name is ${person.name}." """ ~ """ $$$$$$ " """ ~ """ $$$$$$$$$$$ " """ ~ @@ -304,14 +304,14 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { """ $ """ ~ """ $$$$ """ - + } - - private def findSelectionRange(s: String): Range = { + + private def findSelectionRange(s: String): Range = { val barLocation = s indexOf '|' if (barLocation >= 0) Range(barLocation, 0) - else { + else { val firstDollarLocation = s indexOf '$' require(firstDollarLocation >= 0, "No selection marker: " + s) val dollars = s.drop(firstDollarLocation).takeWhile(_ == '$') @@ -320,13 +320,13 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { } implicit def stringToTestString(source: String)(implicit scalaVersion: String = ScalaVersions.DEFAULT_VERSION): TestString = new TestString(source, scalaVersion) - class TestString(source: String, scalaVersion: String) { + class TestString(source: String, scalaVersion: String) { def ~(initialSelectionDiagram: String) = IntermediateTest(source, initialSelectionDiagram, scalaVersion) } - case class IntermediateTest(source: String, initialSelectionDiagram: String, scalaVersion: String) { - def ~(finalSelectionDiagram: String): IntermediateTest = { - val initialSelection = findSelectionRange(initialSelectionDiagram) + case class IntermediateTest(source: String, initialSelectionDiagram: String, scalaVersion: String) { + def ~(finalSelectionDiagram: String): IntermediateTest = { + val initialSelection = findSelectionRange(initialSelectionDiagram) val actualFinalSelection = AstSelector.expandSelection(source, initialSelection, scalaVersion) getOrElse initialSelection val expectedFinalSelection = findSelectionRange(finalSelectionDiagram) ("source\n>>>" + source + "<<<\n") should "expand\n>>>" + (initialSelectionDiagram + "<<<\n to \n>>>" + finalSelectionDiagram + "<<<\n") in { diff --git a/scalariform/src/test/scala/scalariform/formatter/FunctionFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/FunctionFormatterTest.scala index b226bd76..6f88c1aa 100644 --- a/scalariform/src/test/scala/scalariform/formatter/FunctionFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/FunctionFormatterTest.scala @@ -18,7 +18,7 @@ class FunctionFormatterTest extends AbstractFormatterTest { """{ ctx => | ??? |}""".stripMargin - + """{ ctx => j => | ??? |}""".stripMargin ==> @@ -40,7 +40,7 @@ class FunctionFormatterTest extends AbstractFormatterTest { type Result = CompilationUnit def parse(parser: ScalaParser) = parser.compilationUnitOrScript() - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState()) } diff --git a/scalariform/src/test/scala/scalariform/formatter/TypeFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/TypeFormatterTest.scala index 2906e8e0..97b6957e 100644 --- a/scalariform/src/test/scala/scalariform/formatter/TypeFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/TypeFormatterTest.scala @@ -8,40 +8,40 @@ class TypeFormatterTest extends AbstractFormatterTest { "Int" ==> "Int" "List [ String ] " ==> "List[String]" "Map[String,List[ Int]]" ==> "Map[String, List[Int]]" - - "A => B" ==> "A => B" + + "A => B" ==> "A => B" "List/*b*/[/*c*/String/*d*/]" ==> "List /*b*/ [ /*c*/ String /*d*/ ]" - + "Int /*foo*/ Either String" ==> "Int /*foo*/ Either String" - + "List[_>:A<:B]" ==> "List[_ >: A <: B]" "List[_>:A_ <:B_]" ==> "List[_ >: A_ <: B_]" "A_ @Deprecated" ==> "A_ @Deprecated" - "A Either B @Deprecated" ==> "A Either B @Deprecated" - + "A Either B @Deprecated" ==> "A Either B @Deprecated" + "A#B" ==> "A#B" "A_ #B" ==> "A_ #B" "A_# #B" ==> "A_# #B" - "this . type" ==> "this.type" + "this . type" ==> "this.type" "List[a.type]" ==> "List[a.type]" "(a.type, b.type)" ==> "(a.type, b.type)" "(A)#X" ==> "(A)#X" "A @cps[A, C]" ==> "A @cps[A, C]" - + "Int @cps[Int,Int]" ==> "Int @cps[Int, Int]" "{def bar :Unit}" ==> "{ def bar: Unit }" "(A, B) => C" ==> "(A, B) => C" - "(A*) => B" ==> "(A*) => B" - - "(=> A) => B" ==> "(=> A) => B" + "(A*) => B" ==> "(A*) => B" + + "(=> A) => B" ==> "(=> A) => B" "(C, => A) => B" ==> "(C, => A) => B" @@ -51,28 +51,28 @@ class TypeFormatterTest extends AbstractFormatterTest { "(=>A)" ==> "(=> A)" "(=> A#Inner[Int])" ==> "(=> A#Inner[Int])" - + "Int Either String" ==> "Int Either String" - // TODO: forSome clause not valid + // TODO: forSome clause not valid "(=> A#Inner[Int] @Deprecated with B with (C) @Deprecated Either (B, A#Inner[_ <: B]) with C) => B forSome {}" ==> "(=> A#Inner[Int] @Deprecated with B with (C) @Deprecated Either (B, A#Inner[_ <: B]) with C) => B forSome {}" - + "(=> A with B Either (B, A)) => B" ==> "(=> A with B Either (B, A)) => B" - + "b[c# ::[d]]" ==> "b[c# ::[d]]" - """C :: + """C :: | D""" ==> """C :: D""" // To check that this doesn't blow up -- we should maintain the newline - + override val debug = false - + type Result = Type def parse(parser: ScalaParser) = parser.typ() // TODO: ensure EOF - + def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState(indentLevel = 0)) - + } From 5b293169486f4d3218ebd1960d1dc092883b2475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:29:23 +0100 Subject: [PATCH 24/32] Remove tabs in codebase --- .../com/danieltrinh/scalariform/gui/FormatterFrame.scala | 5 ++--- .../scalariform/formatter/ParenAndBracketSpacingTest.scala | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala b/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala index fc8774fd..9ec0ef95 100644 --- a/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala +++ b/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala @@ -454,8 +454,8 @@ object Samples { val sample0 = """class A { - | - |}""".stripMargin + | + |}""".stripMargin val sample1 = """package foo . bar . baz @@ -469,4 +469,3 @@ object Samples { | |}""".stripMargin } // format: ON - diff --git a/scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala b/scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala index a0483aec..63e38b07 100644 --- a/scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala @@ -22,7 +22,7 @@ class ParenAndBracketSpacingTest extends AbstractExpressionFormatterTest { "foo[Bar](baz)[Biz]" ==> "foo[ Bar ](baz)[ Biz ]" "foo[Bar][Baz][Buz]" ==> "foo[ Bar ][ Baz ][ Buz ]" - """foo( + """foo( |alpha = "foo", |beta = bar match { | case _ => "bar" @@ -36,7 +36,7 @@ class ParenAndBracketSpacingTest extends AbstractExpressionFormatterTest { | gamma = false |)""" - """foo( + """foo( |alpha = "foo", |beta = bar( |a = 1 @@ -50,7 +50,7 @@ class ParenAndBracketSpacingTest extends AbstractExpressionFormatterTest { | gamma = false |)""" - """foo( + """foo( |arg = bar( |baz = "a" |).xyz From 376684dedb7408da1375f507f21d9c66808bd2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:35:50 +0100 Subject: [PATCH 25/32] Get rid of false warnings about possible string interpolation --- .../scala/scalariform/astselect/AstSelectorTest.scala | 3 +-- .../formatter/StringInterpolationFormatterTest.scala | 8 ++++---- .../lexer/RedundantSemicolonDetectorTest.scala | 4 ++-- .../src/test/scala/scalariform/lexer/ScalaLexerTest.scala | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala b/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala index 9cdadcf4..9fd1aeb6 100644 --- a/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala +++ b/scalariform/src/test/scala/scalariform/astselect/AstSelectorTest.scala @@ -285,7 +285,7 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { { implicit val scalaVersion = "2.10.0" - """ s"my name is ${person.name}." """ ~ + """ s"my name is ?{person.name}." """.replace('?', '$') ~ """ $$$$$$ " """ ~ """ $$$$$$$$$$$ " """ ~ """ $$$$$$$$$$$$$$ " """ ~ @@ -304,7 +304,6 @@ class AstSelectorTest extends FlatSpec with ShouldMatchers { """ $ """ ~ """ $$$$ """ - } private def findSelectionRange(s: String): Range = { diff --git a/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala b/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala index a4b790bd..bc78c11e 100644 --- a/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala +++ b/scalariform/src/test/scala/scalariform/formatter/StringInterpolationFormatterTest.scala @@ -9,8 +9,8 @@ class StringInterpolationFormatterTest extends AbstractExpressionFormatterTest { s"".text ==> s"".text s"my name is $name".text ==> s"my name is $name".text s"my name is $this".text ==> s"my name is $this".text - """s"my name is ${bob}"""" ==> """s"my name is ${bob}"""" - """s"my name is ${ person.name }"""" ==> """s"my name is ${person.name}"""" + """s"my name is ?{bob}"""".replace('?', '$') ==> """s"my name is ?{bob}"""".replace('?', '$') + """s"my name is ?{ person.name }"""".replace('?', '$') ==> """s"my name is ?{person.name}"""".replace('?', '$') """s"my name is ${ |bob}"""" ==> @@ -29,7 +29,7 @@ class StringInterpolationFormatterTest extends AbstractExpressionFormatterTest { s"""foo""".text ==> s"""foo""".text s"""""".text ==> s"""""".text s"""my name is $name""".text ==> s"""my name is $name""".text - "s\"\"\"my name is ${bob}\"\"\"" ==> "s\"\"\"my name is ${bob}\"\"\"" - "s\"\"\"my name is ${ person.name }\"\"\"" ==> "s\"\"\"my name is ${person.name}\"\"\"" + "s\"\"\"my name is ?{bob}\"\"\"".replace('?', '$') ==> "s\"\"\"my name is ?{bob}\"\"\"".replace('?', '$') + "s\"\"\"my name is ?{ person.name }\"\"\"".replace('?', '$') ==> "s\"\"\"my name is ?{person.name}\"\"\"".replace('?', '$') } diff --git a/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala b/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala index 99a9434e..cfc80702 100644 --- a/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala +++ b/scalariform/src/test/scala/scalariform/lexer/RedundantSemicolonDetectorTest.scala @@ -35,8 +35,8 @@ class RedundantSemicolonDetectorTest extends FlatSpec with ShouldMatchers { { implicit val scalaVersion = "2.10.0"; """ - s"my name is ${person.name<;>}" - """.check + s"my name is ?{person.name<;>}" + """.replace('?', '$').check } private def checkSemis(encodedSource: String, scalaVersion: String) { diff --git a/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala b/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala index f8dc477e..01663fdb 100644 --- a/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala +++ b/scalariform/src/test/scala/scalariform/lexer/ScalaLexerTest.scala @@ -124,8 +124,8 @@ class ScalaLexerTest extends FlatSpec with ShouldMatchers { """ X s "$foo" """ producesTokens (WS, VARID, WS, VARID, WS, STRING_LITERAL, WS) """ s"$foo" """ producesTokens (WS, INTERPOLATION_ID, STRING_PART, VARID, STRING_LITERAL, WS) """ s"$$" """ producesTokens (WS, INTERPOLATION_ID, STRING_LITERAL, WS) - """ s"${foo}" """ producesTokens (WS, INTERPOLATION_ID, STRING_PART, LBRACE, VARID, RBRACE, STRING_LITERAL, WS) - """ s"${s"${x}"}" """ producesTokens (WS, INTERPOLATION_ID, STRING_PART, LBRACE, INTERPOLATION_ID, STRING_PART, LBRACE, VARID, RBRACE, STRING_LITERAL, RBRACE, STRING_LITERAL, WS) + """ s"?{foo}" """.replace('?', '$') producesTokens (WS, INTERPOLATION_ID, STRING_PART, LBRACE, VARID, RBRACE, STRING_LITERAL, WS) + """ s"?{s"?{x}"}" """.replace('?', '$') producesTokens (WS, INTERPOLATION_ID, STRING_PART, LBRACE, INTERPOLATION_ID, STRING_PART, LBRACE, VARID, RBRACE, STRING_LITERAL, RBRACE, STRING_LITERAL, WS) """ s"$this" """ producesTokens (WS, INTERPOLATION_ID, STRING_PART, THIS, STRING_LITERAL, WS) From 5b79b8800f53cc1a73ed53b0fdf0deed384c45f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 16:37:19 +0100 Subject: [PATCH 26/32] Remove unused member in test project --- .../src/test/scala/scalariform/lexer/NewlineInferencerTest.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala b/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala index a5c4122e..b10ac274 100644 --- a/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala +++ b/scalariform/src/test/scala/scalariform/lexer/NewlineInferencerTest.scala @@ -38,7 +38,6 @@ class NewlineInferencerTest extends FlatSpec with ShouldMatchers { val actualTokenTypes = actualTokens.map(_.tokenType) require(actualTokenTypes.last == EOF, "Last token must be EOF, but was " + actualTokens.last.tokenType) require(actualTokenTypes.count(_ == EOF) == 1, "There must only be one EOF token") - val reconstitutedSource = actualTokens.init.map(_.rawText).mkString require(actualTokenTypes.init == expectedTokens, "Tokens do not match. Expected " + expectedTokens + ", but was " + actualTokenTypes.init) } } From 38995ff32bd10f0326f002785c3fbf5831fda460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 17:14:18 +0100 Subject: [PATCH 27/32] Move Scala files to correct directory The package and the directory did not match. --- .../scalariform/commandline/CommandLineOptionParser.scala | 0 .../{com/danieltrinh => }/scalariform/commandline/Main.scala | 0 .../scalariform/commandline/ScalaFileWalker.scala | 0 .../danieltrinh => }/scalariform/corpusscan/CorpusScanner.scala | 0 .../{com/danieltrinh => }/scalariform/gui/FormatterFrame.scala | 0 .../main/scala/{com/danieltrinh => }/scalariform/gui/Main.scala | 0 .../{com/danieltrinh => }/scalariform/gui/ParseTreeModel.scala | 0 .../scala/{com/danieltrinh => }/scalariform/gui/SwingUtils.scala | 0 .../scala/{com/danieltrinh => }/scalariform/gui/TokenTable.scala | 0 .../danieltrinh => }/scalariform/perf/LexerPerformanceTest.scala | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename cli/src/main/scala/{com/danieltrinh => }/scalariform/commandline/CommandLineOptionParser.scala (100%) rename cli/src/main/scala/{com/danieltrinh => }/scalariform/commandline/Main.scala (100%) rename cli/src/main/scala/{com/danieltrinh => }/scalariform/commandline/ScalaFileWalker.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/corpusscan/CorpusScanner.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/gui/FormatterFrame.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/gui/Main.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/gui/ParseTreeModel.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/gui/SwingUtils.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/gui/TokenTable.scala (100%) rename misc/src/main/scala/{com/danieltrinh => }/scalariform/perf/LexerPerformanceTest.scala (100%) diff --git a/cli/src/main/scala/com/danieltrinh/scalariform/commandline/CommandLineOptionParser.scala b/cli/src/main/scala/scalariform/commandline/CommandLineOptionParser.scala similarity index 100% rename from cli/src/main/scala/com/danieltrinh/scalariform/commandline/CommandLineOptionParser.scala rename to cli/src/main/scala/scalariform/commandline/CommandLineOptionParser.scala diff --git a/cli/src/main/scala/com/danieltrinh/scalariform/commandline/Main.scala b/cli/src/main/scala/scalariform/commandline/Main.scala similarity index 100% rename from cli/src/main/scala/com/danieltrinh/scalariform/commandline/Main.scala rename to cli/src/main/scala/scalariform/commandline/Main.scala diff --git a/cli/src/main/scala/com/danieltrinh/scalariform/commandline/ScalaFileWalker.scala b/cli/src/main/scala/scalariform/commandline/ScalaFileWalker.scala similarity index 100% rename from cli/src/main/scala/com/danieltrinh/scalariform/commandline/ScalaFileWalker.scala rename to cli/src/main/scala/scalariform/commandline/ScalaFileWalker.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/corpusscan/CorpusScanner.scala b/misc/src/main/scala/scalariform/corpusscan/CorpusScanner.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/corpusscan/CorpusScanner.scala rename to misc/src/main/scala/scalariform/corpusscan/CorpusScanner.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala b/misc/src/main/scala/scalariform/gui/FormatterFrame.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/gui/FormatterFrame.scala rename to misc/src/main/scala/scalariform/gui/FormatterFrame.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/Main.scala b/misc/src/main/scala/scalariform/gui/Main.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/gui/Main.scala rename to misc/src/main/scala/scalariform/gui/Main.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/ParseTreeModel.scala b/misc/src/main/scala/scalariform/gui/ParseTreeModel.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/gui/ParseTreeModel.scala rename to misc/src/main/scala/scalariform/gui/ParseTreeModel.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/SwingUtils.scala b/misc/src/main/scala/scalariform/gui/SwingUtils.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/gui/SwingUtils.scala rename to misc/src/main/scala/scalariform/gui/SwingUtils.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/gui/TokenTable.scala b/misc/src/main/scala/scalariform/gui/TokenTable.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/gui/TokenTable.scala rename to misc/src/main/scala/scalariform/gui/TokenTable.scala diff --git a/misc/src/main/scala/com/danieltrinh/scalariform/perf/LexerPerformanceTest.scala b/misc/src/main/scala/scalariform/perf/LexerPerformanceTest.scala similarity index 100% rename from misc/src/main/scala/com/danieltrinh/scalariform/perf/LexerPerformanceTest.scala rename to misc/src/main/scala/scalariform/perf/LexerPerformanceTest.scala From 8e7c0553015294d347d9b03e3ab682979dbc1886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 17:19:56 +0100 Subject: [PATCH 28/32] Fix several warnings in misc and cli projects --- .../scalariform/commandline/CommandLineOptionParser.scala | 1 - misc/src/main/scala/scalariform/gui/FormatterFrame.scala | 8 +------- misc/src/main/scala/scalariform/gui/TokenTable.scala | 1 - .../scala/scalariform/perf/LexerPerformanceTest.scala | 2 -- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/cli/src/main/scala/scalariform/commandline/CommandLineOptionParser.scala b/cli/src/main/scala/scalariform/commandline/CommandLineOptionParser.scala index f69b124c..e2a2035a 100644 --- a/cli/src/main/scala/scalariform/commandline/CommandLineOptionParser.scala +++ b/cli/src/main/scala/scalariform/commandline/CommandLineOptionParser.scala @@ -1,6 +1,5 @@ package scalariform.commandline -import scala.util.parsing.input._ import scala.util.parsing.combinator._ class CommandLineOptionParser extends RegexParsers { diff --git a/misc/src/main/scala/scalariform/gui/FormatterFrame.scala b/misc/src/main/scala/scalariform/gui/FormatterFrame.scala index 9ec0ef95..77d53ce0 100644 --- a/misc/src/main/scala/scalariform/gui/FormatterFrame.scala +++ b/misc/src/main/scala/scalariform/gui/FormatterFrame.scala @@ -6,8 +6,6 @@ import java.awt.{ List ⇒ _, _ } import javax.swing._ import javax.swing.text._ import javax.swing.event._ -import javax.swing.tree._ -import javax.swing.table._ import javax.swing.border.TitledBorder import net.miginfocom.layout._ @@ -23,8 +21,6 @@ import scalariform.lexer._ import scalariform.lexer.Tokens._ import scalariform.gui.SwingUtils._ import scalariform.parser._ -import scala.util.parsing.input._ -import scala.util.parsing.combinator._ class FormatterFrame extends JFrame with SpecificFormatter { @@ -159,7 +155,6 @@ class FormatterFrame extends JFrame with SpecificFormatter { if (showAstCheckBox.isSelected) { val tokens = ScalaLexer.tokenise(inputText, scalaVersion = SCALA_VERSION) val rawTokens = ScalaLexer.rawTokenise(inputText, scalaVersion = SCALA_VERSION) - val tableModel = new TokenTableModel(tokens, FormatResult(Map(), Map(), Map())) tokensTable.setTokens(tokens) rawTokensTable.setTokens(rawTokens) try { @@ -192,7 +187,7 @@ class FormatterFrame extends JFrame with SpecificFormatter { astTree.setModel(treeModel) expandAll(astTree) - val (outputText, formatResult) = specificFormatter.fullFormat(inputText, scalaVersion = SCALA_VERSION)(OptionsPanel.getFormattingPreferences) + val (_, formatResult) = specificFormatter.fullFormat(inputText, scalaVersion = SCALA_VERSION)(OptionsPanel.getFormattingPreferences) tokensTable.setTokens(tokens, formatResult) rawTokensTable.setTokens(rawTokens) @@ -315,7 +310,6 @@ class FormatterFrame extends JFrame with SpecificFormatter { val widget = preferenceToWidgetMap(preference) preference.preferenceType match { case prefType @ BooleanPreference ⇒ - val checkBox = widget.asInstanceOf[JCheckBox] preferences = preferences.setPreference(prefType.cast(preference), widget.asInstanceOf[JCheckBox].isSelected) case prefType @ IntegerPreference(min, max) ⇒ preferences = preferences.setPreference( diff --git a/misc/src/main/scala/scalariform/gui/TokenTable.scala b/misc/src/main/scala/scalariform/gui/TokenTable.scala index 15680044..dc9673d0 100644 --- a/misc/src/main/scala/scalariform/gui/TokenTable.scala +++ b/misc/src/main/scala/scalariform/gui/TokenTable.scala @@ -4,7 +4,6 @@ import scalariform.formatter.FormatResult import javax.swing.JTable import scalariform.lexer.Token import javax.swing.table.AbstractTableModel -import scalariform.utils.Range class TokenTable extends JTable(new TokenTableModel(Nil, FormatResult.EMPTY)) { diff --git a/misc/src/main/scala/scalariform/perf/LexerPerformanceTest.scala b/misc/src/main/scala/scalariform/perf/LexerPerformanceTest.scala index da331af6..43c25445 100644 --- a/misc/src/main/scala/scalariform/perf/LexerPerformanceTest.scala +++ b/misc/src/main/scala/scalariform/perf/LexerPerformanceTest.scala @@ -2,10 +2,8 @@ package scalariform.perf import java.io.File import scala.io.Source -import scalariform.parser._ import scalariform.lexer.{ Token ⇒ _, _ } import scalariform.utils.Utils.time -import scalariform.formatter._ object LexerPerformanceTest { From 2d52dbef50a289427f6320de7aa8378959aacb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 17:20:22 +0100 Subject: [PATCH 29/32] Add more scalac options to 2.11 compilation The previous Scala versions don't need to be checked. --- project/Build.scala | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/project/Build.scala b/project/Build.scala index 622a43f8..7f8a7716 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -32,7 +32,23 @@ object ScalariformBuild extends Build { "2.9.3", "2.9.2" //"2.9.1-1", "2.9.1", "2.9.0-1", "2.9.0" ), exportJars := true, // Needed for cli oneJar - scalacOptions += "-deprecation" + scalacOptions ++= (scalaBinaryVersion.value match { + case "2.11" => Seq( + "-deprecation:false", + "-encoding", "UTF-8", + "-feature", + "-language:_", + "-unchecked", + "-Xlint", + "-Xfuture", + "-Xfatal-warnings", + "-Yno-adapted-args", + "-Ywarn-dead-code", + "-Ywarn-unused-import", + "-Ywarn-unused" + ) + case _ => Seq() + }) ) lazy val subprojectSettings = commonSettings ++ Seq( From bf14d2f0bbe035aca3a3a7dbc94a8483019e14b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 18:43:34 +0100 Subject: [PATCH 30/32] Remove scripts folder We no longer need that stuff. --- scripts/count-sloc.sh | 3 --- scripts/update-version.sh | 12 ------------ scripts/version-list.txt | 11 ----------- 3 files changed, 26 deletions(-) delete mode 100755 scripts/count-sloc.sh delete mode 100755 scripts/update-version.sh delete mode 100644 scripts/version-list.txt diff --git a/scripts/count-sloc.sh b/scripts/count-sloc.sh deleted file mode 100755 index c373c0bd..00000000 --- a/scripts/count-sloc.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cd `dirname $0`/.. -cloc --exclude-dir=src_managed,target,docs '--exclude-lang=XML,XSLT,HTML,CSS,Bourne Shell' . diff --git a/scripts/update-version.sh b/scripts/update-version.sh deleted file mode 100755 index e078a714..00000000 --- a/scripts/update-version.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -PREVIOUS=$1 -NEXT=$2 - -cd `dirname $0`/.. - -while read p; do - echo "Changing $p" - sed -i s/$PREVIOUS/$NEXT/g $p -done < scripts/version-list.txt - -git diff diff --git a/scripts/version-list.txt b/scripts/version-list.txt deleted file mode 100644 index 3befec72..00000000 --- a/scripts/version-list.txt +++ /dev/null @@ -1,11 +0,0 @@ -pom.xml -project/Build.scala -scalariform/pom.xml -scalariform.feature/pom.xml -scalariform.feature/feature.xml -scalariform.update/pom.xml -scalariform.update/site.xml -docs/source/conf.py -scalariform/META-INF/MANIFEST.MF -scalariform/src/main/scala/scalariform/package.scala -README.rst From e692c2d95ef89d3d1e6894932002efb3dac06558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 18:50:29 +0100 Subject: [PATCH 31/32] Remove docs folder All docs should be put to the README in the root directory. --- docs/Makefile | 88 ------------------ docs/source/README.rst | 1 - docs/source/conf.py | 198 ----------------------------------------- 3 files changed, 287 deletions(-) delete mode 100644 docs/Makefile delete mode 120000 docs/source/README.rst delete mode 100644 docs/source/conf.py diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index ffb9ceb7..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf build/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html - @echo - @echo "Build finished. The HTML pages are in build/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) build/dirhtml - @echo - @echo "Build finished. The HTML pages are in build/dirhtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in build/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in build/qthelp, like this:" - @echo "# qcollectiongenerator build/qthelp/Scalariform.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile build/qthelp/Scalariform.qhc" - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex - @echo - @echo "Build finished; the LaTeX files are in build/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes - @echo - @echo "The overview file is in build/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in build/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) build/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in build/doctest/output.txt." diff --git a/docs/source/README.rst b/docs/source/README.rst deleted file mode 120000 index c768ff7d..00000000 --- a/docs/source/README.rst +++ /dev/null @@ -1 +0,0 @@ -../../README.rst \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index c08bd721..00000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,198 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Scalariform documentation build configuration file, created by -# sphinx-quickstart on Sat Apr 10 15:15:49 2010. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.append(os.path.abspath('.')) - -# -- General configuration ----------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['github.tools.sphinx'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8' - -# The master toctree document. -master_doc = 'README' - -# General information about the project. -project = u'Scalariform' -copyright = u'2010, Matt Russell' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '0.1.5-SNAPSHOT' -# The full version, including alpha/beta/rc tags. -release = '0.1.5-SNAPSHOT' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of documents that shouldn't be included in the build. -#unused_docs = [] - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = [] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -highlight_language = 'scala' - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "nosidebar": "true" -} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_use_modindex = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Scalariformdoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('README', 'Scalariform.tex', u'Scalariform Documentation', - u'Matt Russell', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_use_modindex = True From 23dc8721e6f0cbc5554aa8099c65c8bc0ec1eaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=A4fer?= Date: Mon, 28 Dec 2015 19:02:30 +0100 Subject: [PATCH 32/32] Update version to 0.2.0 --- README.rst | 2 +- project/Build.scala | 2 +- scalariform/META-INF/MANIFEST.MF | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ea6984b2..d7bcb40b 100644 --- a/README.rst +++ b/README.rst @@ -57,7 +57,7 @@ Usage within a project Have a use for the scalariform source code directly? You can use it as a build dependency: :: - "org.scalariform" %% "scalariform" % "0.1.8" + "org.scalariform" %% "scalariform" % "0.2.0" Integration with Eclipse ------------------------ diff --git a/project/Build.scala b/project/Build.scala index 7f8a7716..848442df 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -24,7 +24,7 @@ object ScalariformBuild extends Build { lazy val commonSettings = SbtScalariform.defaultScalariformSettings ++ sonatypeSettings ++ Seq( organization := "org.scalariform", profileName := "org.scalariform", - version := "0.1.8", + version := "0.2.0-SNAPSHOT", scalaVersion := "2.11.7", crossScalaVersions := Seq( "2.11.7", diff --git a/scalariform/META-INF/MANIFEST.MF b/scalariform/META-INF/MANIFEST.MF index 9be701c8..086aed4b 100644 --- a/scalariform/META-INF/MANIFEST.MF +++ b/scalariform/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Scalariform Bundle-SymbolicName: scalariform -Bundle-Version: 0.1.8.qualifier +Bundle-Version: 0.2.0.qualifier Require-Bundle: org.scala-lang.scala-library, org.scala-lang.modules.scala-xml Bundle-ClassPath: .