-
Notifications
You must be signed in to change notification settings - Fork 181
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
Fill required fields for a new block #719
Comments
We were able to modify We abandoned that approach and instead moved to build a complete snippet with both the type selected and all required attributes and use that as the main TextEdit, in effect replacing the existing text the user just typed. This succeeded in the sense that the correct information was produced but failed in the sense that it was not displayed client side. Further investigation surmised that the additional content for the attributes exceeded the amount of data that could be received and displayed by the client. This led us to the LSP resolve completion method. This would allow the user to received a list of types to select, then select the type, then receive only the required attributes for that type. This requires implementing a new request handler and parsing infrastructure, with some new design considerations, which is out of scope for this ticket. Once that work is complete, this ticket will be picked back up. |
That would be a killer feature. It is implemented in the TF plugin for IntelliJ, and it's the only reason why I use IJ. |
@jpogran implemented this as part of the following PRs which will be part of the upcoming LS / extension release:
As mentioned within these issues, the functionality will be (at least initially) opt-in via We also plan to add code action that would provide comparable functionality for existing blocks, which is tracked under #801 |
That's great news. Thank you. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Problem Statement
Users can today introduce a new block into their configuration via completion
However the block is not considered complete/valid until it has all required attributes and blocks.
This means that users have to either scrolls over a potentially long list of attributes and blocks to add all required ones and/or consult documentation in a separate window.
It would be great if all required attributes and blocks were pre-filled for them.
Expected User Experience
New Block
Upon confirmation of label completion - such as resource type
the editor would also pre-fill all required attributes and blocks
Block with existing attributes/blocks
-> #801
Proposal
AdditionalTextEdits
with required arguments and blocks for relevant label-based completion item (such as resource types, data source types and provider names)See also hashicorp/terraform-ls#96
The text was updated successfully, but these errors were encountered: