Closed petebytes closed 3 years ago
It's not possible for Better Errors to know the "real" path that it's running in when running inside of a virtualized environment like Docker or WSL.
For a case like this you can instead create a proc
where you can modify the file path. For example:
BetterErrors.editor = proc { |file, line|
file = "/some/other/path#{file}"
"vscode://file/%{file}:%{line}" % { file: URI.encode_www_form_component(file), line: line }
}
I highly recommend against committing this file into your project repository though, since it might be very specific to your personal development environment.
Actually, I just found this in the wiki: https://github.com/BetterErrors/better_errors/wiki/Running-on-virtual-machines
Using
BetterErrors.editor = "vscode://file/%{file}:%{line}"
does not generate the correct link for vscode to open the file when the file resides in WSL2