Parse *.tf.json
for references and symbols
#672
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.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).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.
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.
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.
Symbols
Users is able to find symbols declared in JSON files when seeking for symbols across the workspace.