VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 47 forks source link

Fix not finding .terraform dir in some circumstances (another attempt to solve some of #170) #197

Closed matthew16550 closed 6 months ago

matthew16550 commented 5 years ago

Added unit tests and moved the finding function to a new class because it felt wrong making ModuleDetectionUtil.getTerraformDirSomewhere() more visible just to test it.

Changed to use ProjectFileIndex.isInContent() instead of VfsUtilCore.isAncestor(project.baseDir, ...) because the later was causing trouble due to the dir structure of some of my TF projects.

Added caching to the finding function.