Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displays the current direnv state in settings #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Fapiko
Copy link
Contributor

@Fapiko Fapiko commented May 25, 2022

Useful for debugging what the current state of the direnv environment variables are. Shows the current state in settings dialog. Builds on #25 but wanted to keep them separate for simpler PR reviewing.

Updated this PR with better GoLand support. It wouldn't update the env vars after the initial import, this injects them directly into the run config.

@@ -20,7 +20,7 @@ platformDownloadSources = true

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins =
platformPlugins = org.jetbrains.plugins.go
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? I guess that forces everybody to install the go plugin?

I need to test this with say Idea Community.

@Fapiko
Copy link
Contributor Author

Fapiko commented May 31, 2022

I noticed that the way I was getting the env vars here was leaking across projects - it seems it's importing the direnv stuff at the process level instead of during the run config execution. I started bootstrapping my own plugin just to get some familiarity with the IntelliJ plugin system - https://github.com/Fapiko/intellij-better-direnv - feel free to rip anything out of that to bring in here.

The tricky part is the build system - to create a run configuration extension for each IDE type, the only way I found that folks were doing it (EnvFile & ProjectEnv) was to create a Gradle module per IDE to split up the dependencies. The plugin.xml optionally includes sub-xml files depending on whether or not the specified dependency is available, so it should work for all without requiring them to install all the plugins.

From what I could see, if it's not implemented via the run configuration then it's at the process level which means if you have 4 projects open in GoLand, it's going to share the direnv state between them.

@fehnomenal fehnomenal changed the base branch from master to main August 2, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants