PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.86k stars 377 forks source link

Add setting to better toggle block comments #1428

Open invisibleninja06 opened 4 years ago

invisibleninja06 commented 4 years ago

Force block comment start (<#) and end (#>) to be on their own line and indent contents

When toggling a block comment the contents are not indented and if white space was not selected the start and end tags will not be on their own lines. I propose a setting (or two) that would force a newline for the start and end tags and possibly indent the contents. This way when someone goes to toggle block comment it would already be pretty inline with outlined in https://github.com/PoshCode/PowerShellPracticeAndStyle.

Perhaps a dropdown with block comment style similar to the pipeline indentation style option.

I would like that when you toggle block comment that it matches the definition in https://github.com/PoshCode/PowerShellPracticeAndStyle/blob/master/Style-Guide/Documentation-and-Comments.md This is to say the start and end tags on their own lines and the content indented once.

Appreciate any consideration to add this!

SydneyhSmith commented 4 years ago

Thanks for the request @invisibleninja06 I am transferring this to the Script Analyzer repo as the formatting work would need to occur there

bergmeister commented 4 years ago

A reasonable feature request but I don't think implementation of this is going to be that easy as it sounds like and personally I don't see it as a high priority feature, therefore I marked it as up for grabs in case the community wants to have a go.