This commit is contained in:
Eugene Yokota 2016-05-07 20:31:19 -04:00
parent bc90cd2866
commit d437e8299e
1 changed files with 4 additions and 4 deletions

View File

@ -9,8 +9,8 @@ private[sbt] object SbtRefactorings {
import sbt.internal.parser.SbtParser.{ END_OF_LINE, FAKE_FILE }
import sbt.internal.SessionSettings.{ SessionSetting, SbtConfigFile }
val emtpyString = ""
val reverseOrdeingInt = Ordering[Int].reverse
val emptyString = ""
val reverseOrderingInt = Ordering[Int].reverse
/**
* Refactoring a `.sbt` file so that the new settings are used instead of any existing settings.
@ -25,7 +25,7 @@ private[sbt] object SbtRefactorings {
val (file, lines) = configFile
val split = SbtParser(FAKE_FILE, lines)
val recordedCommands = recordCommands(commands, split)
val sortedRecordedCommands = recordedCommands.sortBy(_._1)(reverseOrdeingInt)
val sortedRecordedCommands = recordedCommands.sortBy(_._1)(reverseOrderingInt)
val newContent = replaceFromBottomToTop(lines.mkString(END_OF_LINE), sortedRecordedCommands)
(file, newContent.lines.toList)
@ -63,7 +63,7 @@ private[sbt] object SbtRefactorings {
if (name == treeName) {
val replacement =
if (acc.isEmpty) command.mkString(END_OF_LINE)
else emtpyString
else emptyString
(tree.pos.start, st, replacement) +: acc
} else {
acc