diff --git a/metals/src/main/scala/scala/meta/internal/metals/FormattingProvider.scala b/metals/src/main/scala/scala/meta/internal/metals/FormattingProvider.scala index 807ee7ee27b..6f10324b1fb 100644 --- a/metals/src/main/scala/scala/meta/internal/metals/FormattingProvider.scala +++ b/metals/src/main/scala/scala/meta/internal/metals/FormattingProvider.scala @@ -234,10 +234,6 @@ final class FormattingProvider( tables.dismissedNotifications.CreateScalafmtFile .dismiss(24, TimeUnit.HOURS) None - } else if (item == Messages.dontShowAgain) { - tables.dismissedNotifications.CreateScalafmtFile - .dismissForever() - None } else None } } else Future.successful(None) @@ -424,14 +420,11 @@ final class FormattingProvider( private def scalafmtConf(projectRoot: AbsolutePath): Option[AbsolutePath] = { val configpath = userConfig().scalafmtConfigPath val default: Option[AbsolutePath] = { - val defaultLocation = projectRoot.resolve(defaultScalafmtLocation) - lazy val scalacliDefault = + def defaultLocation = projectRoot.resolve(defaultScalafmtLocation) + def scalacliDefault = projectRoot.resolve(".scala-build/.scalafmt.conf") - lazy val hiddenDefault = projectRoot.resolve(Directories.hiddenScalafmt) - if (defaultLocation.exists) Some(defaultLocation) - else if (scalacliDefault.exists) Some(scalacliDefault) - else if (hiddenDefault.exists) Some(hiddenDefault) - else None + def hiddenDefault = projectRoot.resolve(Directories.hiddenScalafmt) + List(defaultLocation, scalacliDefault, hiddenDefault).find(_.exists) } configpath.orElse(default) }