Duhemm / sbt-errors-summary

sbt plugin to show a summary of compilation messages.
MIT License
201 stars 11 forks source link

Environment variable or setting for full paths #13

Closed jastice closed 5 years ago

jastice commented 7 years ago

The current output of relativized paths breaks source link parsing in some tooling such as IntelliJ IDEA and ENSIME sbt-mode. If this is to be merged into sbt, it should support at least opting out of relative paths and displaying full paths based on an environment variable.

To be automatically compatible with these tools in their current state, enable full paths

Other approaches:

jvican commented 7 years ago

it should support at least opting out of relative paths and displaying full paths based on an environment variable.

Cannot sbt-intellij match the relative paths? You can easily get the base directory and append it.

sbt setting that enables/disables the feature sbt setting that lets you fully configure the output

These two are the way to go, and the ones I rooted for in Twitter.

jastice commented 7 years ago

Cannot sbt-intellij match the relative paths? You can easily get the base directory and append it.

It probably can, with some extra work ;)

jastice commented 7 years ago

Linking issue on our side: https://youtrack.jetbrains.com/issue/SCL-12191

Duhemm commented 7 years ago

@jastice I've added that in #15. You can do something like:

reporterConfig := reporterConfig.value.withShortenPaths(false)

Would that work for you?

jastice commented 7 years ago

@Duhemm Thank you, it will work fine if this is merged into sbt 1.0 before release. If it stays independent, a flag that can be set without having the plugin on the classpath is preferable, so that I could do something like:

SettingKey["reporterShortenPaths"] := false
dwijnand commented 7 years ago

I wonder if this would work 🙈

type ReporterConfig { def withShortenPaths(b: Boolean): ReporterConfig }
SettingKey[ReporterConfig]("reporterConfig") ~= (_ withShortenPaths true)
fommil commented 7 years ago

it needs to be an envvar, we have no power to set sbt settings from sbt-mode and remember that sbt-mode is not ENSIME... many people (way more than you'd think) use Emacs without ensime or sbt-ensime.

Duhemm commented 7 years ago

@fommil Can you communicate with the sbt shell that's running? There's the apply command that can be used to inject settings. That's what IntelliJ is using AFAIK.

fommil commented 7 years ago

@Duhemm we have to do this in all the editors... can't we just have an environment variable for the legacy mode? Also "that can be used to" is a lot harder than you think it is because we have to consider the state of the buffer and the user and the process.

BTW, I am only talking about if it becomes part of sbt core. If it's not going into sbt core then whoever wants to use this plugin can fix it themselves.

jastice commented 7 years ago

We don't use apply in the sbt shell integration precisely because it would need to know about state. Instead we inject an sbt plugin through global settings, which you probably shouldn't do either unless you have a need for it anyway. So for most use cases, a setting that reads an environment variable by default would be easier to integrate with.