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

Detect and re-load terraform version & path change #69

Open
radeksimko opened this issue Apr 25, 2020 · 1 comment
Open

Detect and re-load terraform version & path change #69

radeksimko opened this issue Apr 25, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@radeksimko
Copy link
Member

radeksimko commented Apr 25, 2020

Use-cases

Allow users switching between Terraform versions whilst they have any files open in the IDE.

Attempted Solutions

We perform discovery of the Terraform binary only once per session, so the user has to reopen the session (folder), if they change Terraform version and want to keep all functionality working and accurate.

Proposal

We could trigger re-discovery (of the absolute path to Terraform and its new version) and re-reading of schema.

The trigger for such event could be:

  • tfenv use, or simply change of .terraform-version file
  • disappearance of the current terraform binary
  • byte change of the current terraform binary (its checksum)

Implementation Notes

LSP watching mechanism may limit watchers to the workspace, so we likely couldn't use that to watch for any changes on the terraform binary, assuming that's commonly outside of the workspace.

@radeksimko radeksimko added the enhancement New feature or request label Apr 25, 2020
@radeksimko radeksimko added this to the v0.3.0 milestone Apr 30, 2020
@radeksimko radeksimko self-assigned this May 19, 2020
@radeksimko radeksimko removed their assignment May 27, 2020
@radeksimko
Copy link
Member Author

Based on some local experiments it appears that tfenv should work out of the box, given that it uses a shell script called terraform in placed in $PATH to front the real binary of any particular version.

We may just need to remove terraform.exe lookups for Windows, to enable similar pattern on Windows.

@paultyng paultyng removed this from the v0.3.0 milestone Jun 5, 2020
@radeksimko radeksimko changed the title terraform/discovery: Re-load path to terraform on version change Detect and re-load terraform version & path on change Jul 21, 2021
@radeksimko radeksimko changed the title Detect and re-load terraform version & path on change Detect and re-load terraform version & path change Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants