@@ -527,29 +527,15 @@ object CheckUnused:
527527
528528 def reportUnused ()(using Context ): Unit = if ! refInfos.isNullified then
529529 for (msg, pos, origin) <- warnings do
530- if origin.isEmpty then report.warning(msg, pos)
531- else report.warning(msg, pos, origin)
532- // avoid rewrite if warning will be suppressed (would be nice if reporter knew how to apply actions)
533- msg.actions.headOption match
534- case Some (action) if ctx.run != null =>
535- val dia =
536- if origin.isEmpty then Diagnostic .Warning (msg, pos.sourcePos)
537- else Diagnostic .LintWarning (msg, pos.sourcePos, origin)
538- ctx.run.nn.suppressions.nowarnAction(dia) match
539- case Action .Warning =>
540- WConf .parsed.action(dia) match
541- case Action .Error | Action .Warning =>
542- Rewrites .applyAction(action)
543- case _ =>
544- case _ =>
545- case _ =>
530+ report.warning(msg, pos, origin)
546531
547532 type MessageInfo = (UnusedSymbol , SrcPos , String ) // string is origin or empty
548533
549534 def warnings (using Context ): Array [MessageInfo ] =
550535 val actionable = ctx.settings.rewrite.value.nonEmpty
551536 val warnings = ArrayBuilder .make[MessageInfo ]
552- def warnAt (pos : SrcPos )(msg : UnusedSymbol , origin : String = " " ): Unit = warnings.addOne((msg, pos, origin))
537+ def warnAt (pos : SrcPos )(msg : UnusedSymbol , origin : String = Diagnostic .OriginWarning .NoOrigin ): Unit =
538+ warnings.addOne((msg, pos, origin))
553539 val infos = refInfos
554540
555541 // non-local sym was target of assignment or has a sibling setter that was referenced
@@ -712,7 +698,6 @@ object CheckUnused:
712698
713699 def checkImports () =
714700 import scala .jdk .CollectionConverters .given
715- import Rewrites .ActionPatch
716701 type ImpSel = (Import , ImportSelector )
717702 def isUsed (sel : ImportSelector ): Boolean = infos.sels.containsKey(sel)
718703 def warnImport (warnable : ImpSel , actions : List [CodeAction ] = Nil ): Unit =
0 commit comments