Bicep VS Code extension should show/remove properties with default values
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Is your feature request related to a problem? Please describe.**
I'm desperately trying to migrate away from a set of poorly-understood ARM templates. It's great that there are a bunch of example BICEP projects in the repo but the vast majority appear to be uncommented and suffer from the same issue as ARM templates - i.e every possible parameter has been filled out with no indication of which are defaults and which are "important".
In contrast, when I create a resource in the Azure Portal, it's (generally) quite simple to leave everything at default settings and have the UI guide you through the few mandatory changes.
**Describe the solution you'd like**
This is just a suggestion and perhaps there are better ways to do this but:
- The VS Code extension could provide different styling for parameters which have a *required* non-default value (e.g. names) or a *strongly encouraged* non-default value (e.g. locations).
- The VS Code extension could provide different styling for parameter values which are at their default (factory) setting
- The VS Code extension could provide tooltip descriptions for parameter names and values.
For example when I look at https://github.com/Azure/bicep/blob/main/docs/examples/101/vm-simple-windows/main.bicep (which seems fairly representative) it's entirely unclear whether
```
var addressPrefix = '10.0.0.0/16'
```
is being set for some specific reason or if it's just the standard default. And if it's the default, why can't I just write
```
resource nInter 'Microsoft.Network/networkInterfaces@2020-06-01' = {
name: nicName
location: location
}
```
and have the properties block defaulted?
Contributor guide
Research direction
Use docs/examples/101/vm-simple-windows/main.bicep as the concrete example, then locate the VS Code extension entry points responsible for resource-property display. First establish which default, required, strongly encouraged, and tooltip behaviors are in scope; done means the selected behavior is specified and consistently implemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100