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

Intellisense inside variables #14065

Closed
slavizh opened this issue May 10, 2024 · 3 comments
Closed

Intellisense inside variables #14065

slavizh opened this issue May 10, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@slavizh
Copy link
Contributor

slavizh commented May 10, 2024

Is your feature request related to a problem? Please describe.
This is far fetched scenario but it would be nice if you have created variable and you have assigned that variable to property on resource to inherit the parameters of that property on the variable.

var subnets = [
  {
    
  }
]

resource vnet 'Microsoft.Network/virtualNetworks@2023-11-01' = {
  name: 'vnet'
  properties: {
    subnets: subnets
  }
}

Intellisense should show id, name. etc.

image

//cc @anthony-c-martin

Describe the solution you'd like
A clear and concise description of what you want to happen.

@slavizh
Copy link
Contributor Author

slavizh commented May 10, 2024

also it should work with lambda functions:

image

param mySubnets array

var subnets = map(mySubnets, subnet => {
  
})

resource vnet 'Microsoft.Network/virtualNetworks@2023-11-01' = {
  name: 'vnet'
  properties: {
    subnets: subnets
  }
}

@anthony-c-martin
Copy link
Member

I'm not aware of other programming languages where types will flow back from a variable usage to variable declaration - to me it would be quite surprising to get property name completions in an untyped variable, and unfortunately complex to implement.

We plan to add typing to variables under #9364, which will allow something along the lines of the following (which would support property completions):

var foo <type> = [
]

Given the lack of precedence for this functionality, I'm going to mark this as closed.

@slavizh
Copy link
Contributor Author

slavizh commented May 30, 2024

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants