Skip to content

Commit

Permalink
adapt to scala/scala#9292 (CharSequence)
Browse files Browse the repository at this point in the history
  • Loading branch information
SethTisue committed Nov 6, 2020
1 parent 2447708 commit ae44ac7
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -42,11 +42,11 @@ final class DisableSyntax(config: DisableSyntaxConfig)
val regexDiagnostics = Seq.newBuilder[Diagnostic]
config.regex.foreach { regex =>
val (matcher, pattern, groupIndex) = regex.value match {
case Right(pat) => (pat.matcher(doc.input.chars), pat.pattern, 0)
case Right(pat) => (pat.matcher(java.nio.CharBuffer.wrap(doc.input.chars)), pat.pattern, 0)
case Left(reg) =>
val pattern = reg.pattern
val groupIndex = reg.captureGroup.getOrElse(0)
(pattern.matcher(doc.input.chars), pattern.pattern, groupIndex)
(pattern.matcher(java.nio.CharBuffer.wrap(doc.input.chars)), pattern.pattern, groupIndex)
}

val message = regex.message.getOrElse(s"$pattern is disabled")
Expand Down

0 comments on commit ae44ac7

Please sign in to comment.