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

Parse *.tf.json for references and symbols #672

Merged
merged 1 commit into from
Oct 14, 2021
Merged

Parse *.tf.json for references and symbols #672

merged 1 commit into from
Oct 14, 2021

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Oct 11, 2021

Closes #498

Depends on hashicorp/hcl-lang#88


UX Impact

Completion

References to targetable blocks or attributes (such as variables) declared in JSON are provided to the user as completion candidates in HCL configs.
image5

Hover

Hovering over a reference (such as var.delta) in HCL config provides user details about the reference, such as the type (e.g. string) when the target attribute or block itself is declared in JSON.

image9

Semantic Highlighting

Valid references to targetable blocks or attributes declared in JSON are highlighted accordingly in HCL configs. Note that it may be hard to spot the difference below, but "var." on the screenshot has black+dark-blue colours (highlighted only via static TextMate grammar) or whole dark-blue (semantically highlighted).

image3

Go To References

Using the context menu option "Go to References", the user is able to go from an attribute or a block to any of its references declared in any JSON files.

image8
image11

Go To Definition

Using the context menu option "Go to Definition" or Ctrl/Cmd+click on a reference, the user is able to go from an HCL reference to the definition of a block or an attribute in JSON.

image2
image10

List References

Code lenses providing a number of references to top level blocks continue to be activated on HCL configuration, but will include results from JSON files and (naturally) provide "go-to-reference" pointing to these JSON files.

image7

Symbols

Users is able to find symbols declared in JSON files when seeking for symbols across the workspace.

image6
image4

@github-actions
Copy link

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 Nov 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Support Terraform JSON (*.tf.json) config files
2 participants