Can you (finally) fix the formatting issues?

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Jehoschua
Posts: 63
Joined: Fri Jan 29, 2016 6:23 am

Can you (finally) fix the formatting issues?

Post by Jehoschua »

Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.173
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.18363.0


Good evening

Unfortunately, Sapien PowerShell Studio has some annoying formatting issues.

Example #1: Please allow us to Select Upper Camel Case by default
This is an annoying fun: The code generator creates this code:

Code: Select all

foreach ($Item in $Collection) {
  …	
}
But if one press Enter behind the '{', then we get the more readable 'Upper Camel Case':

Code: Select all

ForEach ($Item in $Collection) {
  …	
}
» It would be great if we could get the 'Upper Camel Case' by default, as other IDE supports, too.
This would help so that we don't deface the code of other developers when we work together.

Example #2: If above 'Else' is a comment, then please correctly indent the 'Else' keyword:

Code: Select all

If ($true) {
	# Do we have a?
	If ($obj -eq 'a') {
		# Code
	}
	# Do we have b?
ElseIf ($obj -eq 'b') {
		# Code
	}
}


Example #3: Very bad code formatting for Param():
Sapien wastes many lines if the Param() lines are formatted. We prefer this - it's perfectly readable and we usually get the overview of all parameters without scrolling:

Code: Select all

[CmdletBinding()]
Param (
	[Parameter(Position = 0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
	[String]$GroupName,
	# Comment 1
	[Switch]$Recursive = $true,
	# Comment 2
	[Switch]$SkipDisabledUsers
)
If Sapien formats this code, then we don't get a useful result:

Code: Select all

[CmdletBinding()]
Param (
	[Parameter(Position = 0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
	[String]$GroupName,
	
	# Comment 1

	
	[Switch]$Recursive = $true,
	
	# Comment 2

	
	[Switch]$SkipDisabledUsers
)
Sapien has those issues for a long time.
If you're not able to fix it:
Would it possibly be possible to integrate an external code formatting tool?
I don't know if there is a useful tool.

Thanks a lot, kind regards,
Thomas

User avatar
brittneyr
Site Admin
Posts: 613
Joined: Thu Jun 01, 2017 7:20 am
Answers: 6
Been upvoted: 5 times

Re: Can you (finally) fix the formatting issues?

Post by brittneyr »

We appreciate your feedback and will look into these issues. When I have more information, I'll post here.
Brittney Ryn
SAPIEN Technologies, Inc.