Closed jstrachan closed 1 month ago
You can use a settings file to modify how stack frames get presented. This will produce links that will get opened in IntelliJ:
amends "pkl:settings"
editor = Idea
Here's my personal one, which outputs anchors (supported by iTerm 2, not sure about other terminals)
amends "pkl:settings"
local schema: String = "idea"
// https://iterm2.com/documentation-escape-codes.html
local ESC: String = "\u{1B}"
local OSC8: String = "\(ESC)]8"
local ST: String = "\(ESC)\\"
local COLOR_DIM_BLUE: String = "\(ESC)[2;34m"
local COLOR_RESET: String = "\(ESC)[0m"
editor {
urlScheme = "\(COLOR_DIM_BLUE)\(OSC8);;\(schema)://open?file=%{path}&line=%{line}\(ST)%{path}:%{line}\(OSC8);;\(ST)\(COLOR_RESET)"
}
love that! would be good to add to the docs
when running
pkl test
inside IntelliJ as a command we get nice links to source files in the output when things faile.g. the output is something like this...
clicking on those file URLs work and the source is opened - at line 1
if we modified the output ever so slightly to be....
then IntelliJ would open the file at the line
34
if you click on the above link which would help folks navigate to the source of an error/test failure more quickly