fehnomenal / intellij-direnv

direnv integration for JetBrains IDEs
MIT License
67 stars 21 forks source link

Add an option to search for .envrc in parent directories. #65

Open dshatz opened 4 weeks ago

dshatz commented 4 weeks ago

As far as I understand, this is default behavior of direnv anyway so should be logical to have this in the plugin. I added a settings entry which defaults to false as well. image

Also notification ".envrc found" now includes the path of the file image

Tested on a setup like described in #64

Also tested on a a project with no .envrc anywhere in the parent directories (the plugin is then looking up everything until it reaches /). Nothing crashes, this in the logs:

2024-10-16 16:02:56,528 [   9977]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home/dshatz/dev/test-no-envrc directory for .envrc
2024-10-16 16:02:56,529 [   9978]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home/dshatz/dev directory for .envrc
2024-10-16 16:02:56,533 [   9982]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home/dshatz directory for .envrc
2024-10-16 16:02:56,561 [  10010]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home directory for .envrc
2024-10-16 16:02:56,567 [  10016]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning / directory for .envrc
2024-10-16 16:02:56,574 [  10023]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Project test-no-envrc contains no .envrc file
dshatz commented 4 weeks ago

Now I'm thinking - maybe a better approach is to parse direnv status.

Loaded RC path /home/dshatz/dev/boxes/python/.envrc