bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Add the ability to enable/disable preview features through Bicep config

Open anthony-c-martin opened this issue 1 year ago • 1 comments

It would be helpful to give users the ability to preview new functionality through a switch in the bicepconfig.json.

anthony-c-martin avatar Aug 12 '22 21:08 anthony-c-martin

This may require a change to the IFeatureProvider interface, as Bicep configuration is discovered based on a template's position in the file system rather than the context in which the compiler is invoked. So given a main file at ~/main.bicep that deploys a module found at ~/subdir/module.bicep and config files at ~/bicepconfig.json and ~/subdir/bicepconfig.json, the module would be compiled using the config at ~/subdir/bicepconfig.json, whereas the main template would use the config at ~/bicepconfig.json. The config wouldn't change based on the working directory of the compilation process.

To support reading from config, the properties in IFeatureProvider would need to be changed to methods that accept a template URI as a parameter. I'm not sure what we should do about unsaved buffers in the language server or modules using template specs, and I'm not sure if containers in the registry are allowed/expected to have an accompanying bicepconfig.json file.

jeskew avatar Aug 16 '22 15:08 jeskew