Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 2.07 KB

README.md

File metadata and controls

59 lines (39 loc) · 2.07 KB

SBT Hyperlink travis-badge bintray-badge

A plugin to hyperlink files from error messages on the console

Before:

before

After: after

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.

Usage

This plugin requires sbt 1.0.0+

Add this to your ~/.sbt/1.0/plugins/plugins.sbt:

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 the hyperlinks option to true in your config which is by default false)

By default, file:// links will be generated for any absolute path to a file of the project in the format:

baseDirectory/path/file:line[:column]:

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 ~/.sbt/1.0/global.sbt:

hyperlinkAction := sbthyperlink.TermlinkAction

Testing

Run test for regular unit tests.

Run scripted for sbt script tests.