Skip to content

Commit

Permalink
bugfix: fix SymbolNotFound regex
Browse files Browse the repository at this point in the history
This fixes the bug where the user has -explain scalac flag set
and executing Code Actions on a missing symbol did not offer to import
the symbol, due to extra text the regex previously failed to parse.
  • Loading branch information
KaranAhlawat authored and tgodzik committed Oct 20, 2023
1 parent 338af7d commit 8d589bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ object ScalacDiagnostic {
}

object SymbolNotFound {
private val regex = """(n|N)ot found: (value|type)?\s?(\w+)""".r
private val regex = """(n|N)ot found: (value|type)?\s?(\w+)(\s|\S)*""".r
def unapply(d: l.Diagnostic): Option[String] =
d.getMessage().trim() match {
case regex(_, _, name) => Some(name)
case regex(_, _, name, _) => Some(name)
case _ => None
}
}
Expand Down

0 comments on commit 8d589bb

Please sign in to comment.