Skip to content

Commit

Permalink
chore: Adjust tests to include disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Aug 19, 2024
1 parent 38f87ee commit ead4e2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sealed abstract class OrganizeImports(
title = this.title,
kind = this.kind,
disabledReason =
Some("Can not organize imports if file has error"),
Some("Cannot organize imports if the file has an error"),
)
)
)
Expand Down
9 changes: 7 additions & 2 deletions tests/unit/src/main/scala/tests/TestingServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1410,8 +1410,13 @@ final case class TestingServer(
.asScala
.map(_.asScala.filter(filterAction))
} yield (
codeActions.toList,
codeActions.map(_.getTitle()).mkString("\n"),
codeActions.toList.filter(_.getDisabled() == null),
codeActions
.map(a =>
a.getTitle() +
Option(a.getDisabled()).fold("")(_ => " (disabled)")
)
.mkString("\n"),
)

def assertSemanticHighlight(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class OrganizeImportsLspSuite
| val a: Int = "no one wants unused imports"
|}
|""".stripMargin,
"", // This should give back no code action
s"${SourceOrganizeImports.title} (disabled)",
"""|package a
|
|import java.time.Instant
Expand Down

0 comments on commit ead4e2e

Please sign in to comment.