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

refactor: Reflect upstream hcl-lang changes #689

Merged
merged 2 commits into from
Nov 1, 2021
Merged

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Oct 28, 2021

Depends on hashicorp/hcl-lang#92

This is to prepare for module enhancements as described in hashicorp/vscode-terraform#715

Closes #658

One other minor side effect of the refactoring is that we now highlight the DefRange (if available) of a definition instead of the whole Range. For example, when you click to var.foobar it takes you to the same location, but variable "foobar" is highlighted, instead of the whole variable block.


In addition to decoder changes described already in the upstream PR there is a few more changes here.

  • This represents first steps towards getting rid of the context package which makes the codebase more prone to import cycles and goes against best practices. The remaining necessary context-related logic is broken down into the packages which produce the relevant data.
  • Similarly passing dependencies via context goes against best practices in Go and reduces the chance of catching bugs early via compile-time checks
  • This also represents first steps towards slimming down and getting rid of the ModuleManager

@radeksimko radeksimko force-pushed the f-decoder-refactoring branch from b25e99e to 52b5b15 Compare October 28, 2021 14:24
@radeksimko radeksimko marked this pull request as ready for review October 29, 2021 11:26
@radeksimko radeksimko requested a review from a team October 29, 2021 11:35
@radeksimko radeksimko force-pushed the f-decoder-refactoring branch from 52b5b15 to c5de8f7 Compare October 29, 2021 11:35
@radeksimko radeksimko added the enhancement New feature or request label Oct 29, 2021
Copy link
Contributor

@jpogran jpogran left a comment

Choose a reason for hiding this comment

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

After Radek walked me through the changes, and explained the refactoring, this looks like it will be a great change to make. I think this will not only help for modules, but also for the Prefill Required Fields CodeAction I want to implement later.

@radeksimko radeksimko force-pushed the f-decoder-refactoring branch from c5de8f7 to 589dfdf Compare October 31, 2021 11:57
@radeksimko
Copy link
Member Author

The CI failure is unrelated to the PR:

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
thalesgroup/ciphertrust: no available releases match the given constraints

@radeksimko radeksimko merged commit 6fb9f47 into main Nov 1, 2021
@radeksimko radeksimko deleted the f-decoder-refactoring branch November 1, 2021 08:42
@github-actions
Copy link

github-actions bot commented Dec 2, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide workspace-wide symbols for variables in tfvars files
2 participants