Azure / Azure/bicep

Newline formatting - support both approaches

Open
#13,501 1 comment 0 reactions 1 assignee Claimed by @shenglol View on GitHub
enhancement Needs: Upvote
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**
On today's community call (2/29), a team member shared different approaches to applying newline formatting (single-line to multi-line). I shared my take on the call and was prompted to repeat it here.

**Describe the solution you'd like**
The options as described were:
1) Splitting arrays based on the first newline, enable by default
2) Splitting arrays based on the first newline, disable by default
3) Don't split arrays based on the first newline

What I'd prefer to see is the ability to specify two preferred options:
1) Let the developer indicate a preference for either multi-line or single-line
2) Let the developer indicate a preference for either splitting the array to multi-line based on the first newline (e.g. after the first argument) or not.

Pick either option as the Bicep default but let the developer override it as they prefer. Finally, in the options menu (in Resharper, this is Alt + Enter or Ctrl + , depending on how this is configured), make that the first option. When the caret is located in a line with a single- or multi-line array, make the first option a command to switch to the other format, and vice-versa.

By having this, developers get to use whatever option they're most comfortable with locally, but also have an easy way to toggle between the two (maybe the developer prefers single-line arrays, but in this case the string elements are too long, so it's just easier to read in multi-line). Rather than change their options and strictly get the other approach, the toggle allows this override on a case by case basis over the developer's local preferences.

Thank you for the consideration!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.