intellij-direnv
intellij-direnv copied to clipboard
Does not work on GoLand
https://plugins.jetbrains.com/plugin/15285-direnv-integration/reviews#review=51879
I have the same issue with GoLand (and also IntelliJ IDEA).
Looked at the code:
val process = executeDirenv(envrcFile, "export", "json")
if (process.waitFor() != 0) {
handleDirenvError(process, envrcFile)
return
}
val notification = jsonFactory.createParser(process.inputStream).use { parser ->
it seems the plugin wants to parse the output of direnv export json
. And apparently that used to work some while ago - https://github.com/direnv/direnv/issues/467 . However if I try to manually run that command in the workdir containing .envrc the command succeeds but I get no output whatsoever (direnv allow .
or not does not matter). So on first sight it appears that all the issues with intellij-direnv not doing anything come from the fact that direnv api has changed (or is not working as expected)? Does anyone know something about this? The command is still available tho https://github.com/direnv/direnv/blob/master/cmd_export.go
Low hanging fruit theory - that direnv
somehow changed the API which broke the integration can be dismissed I guess (see related issue).
My next theory / question is regarding https://github.com/fehnomenal/intellij-direnv/blob/master/src/main/kotlin/systems/fehn/intellijdirenv/services/EnvironmentService.kt. Ok, I can see how you change response of System.getenv()
with some reflection. But I wonder how does that even work? I mean some other part could directly call functions to get environment variables and be totally unaffected by this or am I mistaken?
Workaround for a single project (i.e. without this plugin): start GoLand from the terminal, which then has all environment from direnv
already loaded:
For macos, this is
open -a goland