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

Autoformat Ruins Section Formatting #4208

Closed
dciborow opened this issue Aug 29, 2021 · 3 comments
Closed

Autoformat Ruins Section Formatting #4208

dciborow opened this issue Aug 29, 2021 · 3 comments

Comments

@dciborow
Copy link
Collaborator

Perhaps I am using tans and comments in a way not intended...

Previously with an arm template json, I could collapse element sections, like parameters down into a single line.

I have found I can replicate this like...

//Variables
  var test1 = 1
  var test2 = 2
//

Now all the variables will collapse under my header. I could eve go further and have nested sections using tabs like this.
But autoformat brings them right back the beginning of the line, and ruins my nested sections.

@ghost ghost added the Needs: Triage 🔍 label Aug 29, 2021
@anthony-c-martin
Copy link
Member

Correct - Bicep has no understanding of "sections", which is why the formatter resets your file to the default formatting.

@alex-frankel
Copy link
Collaborator

@dciborow - I think this would be solved with #46, so I'm going to close this one and we can track there.

@dciborow
Copy link
Collaborator Author

dciborow commented Sep 7, 2021

@alex-frankel and @anthony-c-martin ,

So maybe i have found a bug in the way VSO Code does it's code folding, which is what the other PR is requesting.

It already exists... simply by tabbing in under a comment. And as far as I can tell this does not impact the compilation.

So, if the auto formatter simply did not stripe away the tab characters I am putting at the beginning of my lines, we would have region folding in VSCode.

@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants