-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Prefill Required Fields Completion
On block completion, provide a snippet that completes the label and also the required fields for that block. Currently users can introduce a new block into their configuration using our auto-complete snippet. This snippet only provides the lable name and completes the stanza. However the block is not considered complete/valid until it has all required attributes and blocks. This means that users have to either scroll over a potentially long list of attributes and blocks to add all required ones and/or consult documentation in a separate window. This commit modifies the label completion logic to provide an auto-complete snippet that lists all required fields (attributes and blocks) and expands the TextEdit range to the entire line instead of just to the tabstop. This will replace the entire line with the chosen snippet. The attributes and blocks are sorted alphabetically to ensure consistent ordering for each invocation. For example, when completing the `aws_appmesh_route` resource type, the `mesh_name`, `name`, `virtual_router_name` attributes and the `spec` block will fill in on accepting the completion. Then, the user can tab through to enter in the appropriate value for each field. ``` resource "aws_appmesh_route" "{2:name}" { mesh_name = "${3:value}" name = "${4:value}" virtual_router_name = "${:value}" spec { } ${0} } ```
- Loading branch information
Showing
8 changed files
with
800 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.