bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Vs Code Format Document keeps on indenting further

Open afscrome opened this issue 3 years ago • 0 comments

Bicep version VSCode 0.10.61

Describe the bug A slightly odd situation I encountered when I forgot a quote - each time I ran format document, the template got indented level. I'd expect

To Reproduce

Paste the below code into VS Code

resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' existing = {
  resource blobServices 'blobServices' existing = {
    name: $account
  }
}

Run "Format Document" several times. Eventually you'll end up with

resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' existing = {
                                  resource blobServices 'blobServices' existing = {
                                    name: $account
                                  }
}

Except for the first use, I'd expect subsequent runs of "Format Document" to not change the document any further than the first run

Additional context The problem seems to be specifically to do with the $ character - remove that and "Format Document" behaves as expected.

afscrome avatar Sep 30 '22 13:09 afscrome