Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not fail when stripping ansi codes #4048

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import scala.meta.io.AbsolutePath
import scala.meta.io.RelativePath

import ch.epfl.scala.{bsp4j => b}
import fansi.ErrorMode
import io.undertow.server.HttpServerExchange
import org.eclipse.lsp4j.TextDocumentIdentifier
import org.eclipse.{lsp4j => l}
Expand Down Expand Up @@ -751,7 +752,7 @@ object MetalsEnrichments
def toLSP: l.Diagnostic =
new l.Diagnostic(
diag.getRange.toLSP,
fansi.Str(diag.getMessage).plainText,
fansi.Str(diag.getMessage, ErrorMode.Strip).plainText,
diag.getSeverity.toLSP,
if (diag.getSource == null) "scalac" else diag.getSource
// We omit diag.getCode since Bloop's BSP implementation uses 'code' with different semantics
Expand Down