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

Scaffold required resource snippet based on the resourceType & apiVersion #804

Closed
SenthuranSivananthan opened this issue Nov 3, 2020 · 3 comments · Fixed by #2172
Closed
Assignees
Milestone

Comments

@SenthuranSivananthan
Copy link

Is your feature request related to a problem? Please describe.
It's time consuming to figure out which fields are required when a new resource is being created. I would like to depend on Intellisense and auto-complete the aid with this discovery.

Describe the solution you'd like
My suggestion:

  1. I enter the type & api version: resource stg 'Microsoft.Storage/storageAccounts@2019-06-01'
  2. Select auto complete prompts for { }
  3. The body of the resource is automatically created with all required fields based on the type and apiVersion, i.e.
resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' = {
    name: ''
    kind:''
    sku: {
        name:''
    }
    properties: {
        accessTier: ''
    }
    location: ''
}

This helps with discovery and expedites creating resources.

This experience can also be expanded for modules.

@SenthuranSivananthan SenthuranSivananthan added the enhancement New feature or request label Nov 3, 2020
@ghost ghost added the Needs: Triage 🔍 label Nov 3, 2020
@majastrz
Copy link
Member

majastrz commented Nov 3, 2020

With the way completions and our type system work today, we can very easily generate a contextual snippet that would contain all the required properties that is relevant to the context that we're in. The difficult part will be ensuring that we preserve the user's indentation and formatting when we generate a multi-line snippet.

Open Questions

  1. Should these be recursive or only populate required properties one level at a time. Or provide an option for both?
  2. How would you prefer to trigger this behavior. Should it be available via a completion or a code fix/action?

@SenthuranSivananthan
Copy link
Author

  1. I think it should be recursive given that many of the required fields are already 1 level deep in the properties. Should we assume that it's a create operation since the required fields differ for update operations.

  2. I prefer it directly in code completion so that it's part of the typing gesture for creating the resource.

@alex-frankel alex-frankel changed the title Scaffold required properties based on the resourceType & apiVersion. Scaffold required resource snippet based on the resourceType & apiVersion Nov 5, 2020
@alex-frankel alex-frankel added this to the Committed Backlog milestone Nov 5, 2020
@alex-frankel alex-frankel added the Needs: Author Feedback Awaiting feedback from the author of the issue label Nov 5, 2020
@MarcusFelling MarcusFelling modified the milestones: Committed Backlog, v0.4 Jan 19, 2021
@MarcusFelling
Copy link
Collaborator

Prerequisite: #71

@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants