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

Introduce earlydecoder & refactor SchemaMerger to integrate w/ schema cache #35

Merged
merged 5 commits into from
Apr 19, 2021

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Apr 9, 2021

This is to support an upcoming LS-side change described in hashicorp/terraform-ls#354

Previously "early decoding" to find out provider requirements was actually done just prior to schema merging. This PR formalizes this stage and decouples the logic into its own package earlydecoder which can be also used independently and more efficiently by the LS.

This in turn enables us to:

  • actually implement cache schema, where 1 provider is 1 entry and lookups are done individually on per-provider basis
  • (later) expose requirements without further schema merging (e.g. display those requirements in the editor UI somehow)
  • (later) better understand when/whether requirements have changed and e.g. whether we should nudge the user for re-init

Conversion from tfjson to hcl-lang.schema was also decoupled, so that the LS can perform this conversion early and store the schema in the desired format already in memdb internally.

@radeksimko radeksimko marked this pull request as ready for review April 12, 2021 08:02
@radeksimko radeksimko requested a review from a team April 12, 2021 08:07
Copy link

@aeschright aeschright left a comment

Choose a reason for hiding this comment

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

🚀

@radeksimko radeksimko merged commit 62efc04 into main Apr 19, 2021
@radeksimko radeksimko deleted the f-module-meta branch April 19, 2021 19:29
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.

2 participants