microsoft / vscode-azurearmtools

Azure Resource Manager Tools for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools
MIT License
134 stars 81 forks source link

Add native support for Regions in the ARM Template Language #1122

Open kilasuit opened 3 years ago

kilasuit commented 3 years ago

Making use of another extension in vscode gives the ability to use single level regions in ARM templates Region Folder as long as you add the following to your settings file

"maptz.regionfolder": {
        "[arm-template]": { //Language selector
            "foldEnd": "*/* #endregion */",
            "foldEndRegex": "[\\s]/\\*[\\s]*#endregion",
            "foldStart": "*/* #region [NAME] */",
            "foldStartRegex": "^[\\s]*/\\*[\\s]*#region[\\s]*(.*)[\\s]*\\*/[\\s]*$",
            "disableFolding": false //Turn off #region folding for this language
        }
    }

Ideally though ARM Template Language should support natively the ability to have region support and should support multiple levels of regions as opposed to a single level

StephenWeatherford commented 3 years ago

@kilasuit Ideally how would you like built-in folding to behave? The extension mentioned above seems to disable the built-in JSON region folding that we currently support, is that intended?