Skip to content

Commit

Permalink
Add try in order not to break debugging session
Browse files Browse the repository at this point in the history
While testing on windows I encounter still some issues for classes within `src.zip` JDK sources.

It was throwing FileSytemNotFound exceptions and I was not able to figure out what was going on.

This is a quickfix for this release so that it's possible to use breakpoints properly on Windows, the only thing this will do is that it might sometimes be impossible to go to JDK sources.
  • Loading branch information
tgodzik committed Nov 3, 2021
1 parent cfa30f3 commit fdc619d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private[debug] final class SourcePathAdapter(
}
}

def toMetalsPath(sourcePath: String): Option[AbsolutePath] = {
def toMetalsPath(sourcePath: String): Option[AbsolutePath] = try {
val sourceUri =
Try(URI.create(sourcePath)).getOrElse(Paths.get(sourcePath).toUri())
sourceUri.getScheme match {
Expand All @@ -47,6 +47,10 @@ private[debug] final class SourcePathAdapter(
case "file" => Some(AbsolutePath(Paths.get(sourceUri)))
case _ => None
}
} catch {
case e: Throwable =>
scribe.error(s"Could not resolve $sourcePath", e)
None
}
}

Expand Down

0 comments on commit fdc619d

Please sign in to comment.