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

Add the Variable struct #47

Merged
merged 4 commits into from
Jun 1, 2021
Merged

Conversation

Nepomuceno
Copy link
Contributor

Adding a struct to represent the variable block in the terraform files
This will help in storing this values while parsing tf files.

@hashicorp-cla
Copy link

hashicorp-cla commented May 27, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

This is a great start! 👍🏻

Aside from my in-line comment - I think that we can also leverage the new struct in the earlydecoder and add a test for the collection of variables there?
https://github.com/hashicorp/terraform-schema/blob/main/earlydecoder/decoder.go

Then you could raise a separate PR to terraform-ls which implements steps 3 and 4 of hashicorp/terraform-ls#50

and then finally carry on with the rest of hashicorp/terraform-ls#537

module/variable.go Show resolved Hide resolved
module/variable.go Outdated Show resolved Hide resolved
module/variable.go Outdated Show resolved Hide resolved
module/variable.go Outdated Show resolved Hide resolved
@Nepomuceno Nepomuceno force-pushed the add-variable branch 2 times, most recently from 49b7c13 to b43d158 Compare May 27, 2021 08:32
@radeksimko
Copy link
Member

I'm going to have #48 reviewed first and then once merged I'd like to revisit this PR, rebase it and see if we can introduce the typeexpr fork here and use it to parse variables in the appropriate format into these new structs.

Adding a struct to represent the variable block in the terraform files
This will help in storing this values while parsing tf files.
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

LGTM, aside from my in-line comments (most of which are nitpicks) 😉

earlydecoder/decoder_test.go Outdated Show resolved Hide resolved
earlydecoder/load_module.go Show resolved Hide resolved
earlydecoder/schema.go Outdated Show resolved Hide resolved
internal/typeexpr/doc.go Show resolved Hide resolved
@radeksimko radeksimko merged commit 85a7417 into hashicorp:main Jun 1, 2021
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.

3 participants