diff --git a/tests/slow/src/main/scala/tests/scalacli/BaseScalaCLIActionSuite.scala b/tests/slow/src/main/scala/tests/scalacli/BaseScalaCLIActionSuite.scala index 0a393090de0..3fd1e3b930e 100644 --- a/tests/slow/src/main/scala/tests/scalacli/BaseScalaCLIActionSuite.scala +++ b/tests/slow/src/main/scala/tests/scalacli/BaseScalaCLIActionSuite.scala @@ -96,6 +96,7 @@ class BaseScalaCLIActionSuite(name: String) expectError, filterAction, overrideLayout = layout, + isDiagnosticBased = true, ) } } diff --git a/tests/unit/src/main/scala/tests/codeactions/BaseCodeActionLspSuite.scala b/tests/unit/src/main/scala/tests/codeactions/BaseCodeActionLspSuite.scala index 6350030fa41..bd47c68c07b 100644 --- a/tests/unit/src/main/scala/tests/codeactions/BaseCodeActionLspSuite.scala +++ b/tests/unit/src/main/scala/tests/codeactions/BaseCodeActionLspSuite.scala @@ -59,6 +59,7 @@ abstract class BaseCodeActionLspSuite( expectError: Boolean = false, filterAction: CodeAction => Boolean = _ => true, overrideLayout: Option[String] = None, + isDiagnosticBased: Boolean = false, )(implicit loc: Location): Unit = { val scalacOptionsJson = if (scalacOptions.nonEmpty) @@ -88,6 +89,7 @@ abstract class BaseCodeActionLspSuite( changeFile, expectError, filterAction, + isDiagnosticBased, ) } @@ -105,6 +107,7 @@ abstract class BaseCodeActionLspSuite( changeFile: String => String = identity, expectError: Boolean = false, filterAction: CodeAction => Boolean = _ => true, + isDiagnosticBased: Boolean = false, )(implicit loc: Location): Unit = { val files = FileLayout.mapFromString(layout) val (path, input) = files @@ -135,6 +138,9 @@ abstract class BaseCodeActionLspSuite( path, changeFile(input).replace("<<", "").replace(">>", ""), ) + _ <- + if (isDiagnosticBased) server.didSave(path)(identity) + else Future.successful(()) codeActions <- server .assertCodeAction(