A plugin to hyperlink files from error messages on the console
A link is generated using ANSI escape sequences and the path is shortened. Clicking the link opens your editor at the referenced line and column.
This plugin requires sbt 1.0.0+
Add this to your
addSbtPlugin("de.cbley" % "sbt-hyperlink" % "0.0.1")
You need a terminal emulator which supports hyperlinks. Here is a comprehensive list.
I am using Termite. (Note, you need to set
hyperlinks option to
true in your config which is by default
file:// links will be generated for any absolute path to a file of the project in the format:
which matches paths in compiler error messages like:
src/main/scala/sbthyperlink/HyperlinkPlugin.scala:36:1: not found: value xxx
Clicking on these links opens the file using the default application associated with the file type.
Unfortunately, that method does not support specifying the line and column number to open. If you want to position the cursor at the specified line (or column), have a look at termlink.
When you want to use the
termlink helper, simply add this to
hyperlinkAction := sbthyperlink.TermlinkAction
test for regular unit tests.
scripted for sbt script tests.