PowerShell Studio 2018 auto-closing error

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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
JohnMoe
Posts: 3
Joined: Sun Apr 15, 2018 11:36 pm

PowerShell Studio 2018 auto-closing error

Post by JohnMoe » Thu Jul 19, 2018 5:27 pm

Hi all,

I'm using PowerShell Studio 2018 Version 5.5.153 64-bit on Windows 10 Pro 64-bit. I've disabled all Auto-insert options, as moving my hand to navigation around them slows down my typing. This works for most things, like parenthesis, quotes, etc., but for some reason, when I'm putting in parameter lists to my functions, it's inserting a closing ']':

Code: Select all

function test() {
  param (
    [Parameter(
After typing the "(", it auto-inserts a closing "]" for me.

Also, is there a way I can tell it not to squish my parameter type declaration into the name? So

Code: Select all

[System.String] $myString
doesn't get mashed together like:

Code: Select all

[System.String]$myString
Cheers,

John Moe

User avatar
mxtrinidad
Site Admin
Posts: 209
Joined: Sun Mar 03, 2013 12:42 pm

Re: PowerShell Studio 2018 auto-closing error

Post by mxtrinidad » Thu Jul 19, 2018 6:17 pm

Hum! I don't seem replicate the issue with the parameter part. It works on my end:

function test() {
param (
[parameter()])
:
};

Although, I never seen the function name with parenthesis "test()".

I do agree about having a space between the type accelerator and the variable:
[string] $test

Thanks for letting us know and will get back to you.
:)

User avatar
davidc
Posts: 5398
Joined: Thu Aug 18, 2011 4:56 am

Re: PowerShell Studio 2018 auto-closing error

Post by davidc » Fri Jul 20, 2018 8:03 am

PrimalSense will complete the type closing bracket automatically. We will tie this to the Auto-insert option for square brackets.

As for the spacing, I will make a note, but I encourage you to file a feature request using our feature requests page:

https://www.sapien.com/requests
David
SAPIEN Technologies, Inc.

User avatar
JohnMoe
Posts: 3
Joined: Sun Apr 15, 2018 11:36 pm

Re: PowerShell Studio 2018 auto-closing error

Post by JohnMoe » Wed Aug 01, 2018 6:05 pm

Hi David,

Sorry for not getting back to you sooner; I got the original reply notification from MXTrinidad, but I didn't get one from your reply, so I didn't know there was anything new to read. :-)

I know that there is an option to auto-insert square brackets; my point is with that turned off, in that instance, it still auto-inserts the closing bracket, which then makes the previous code look like this after I type the last open parenthesis:

Code: Select all

function test {
  param (
    [Parameter(]
As for the other item, I'll make a feature request now. :-)

Cheers,

John Moe

User avatar
davidc
Posts: 5398
Joined: Thu Aug 18, 2011 4:56 am

Re: PowerShell Studio 2018 auto-closing error

Post by davidc » Thu Aug 02, 2018 6:55 am

It will be tied to the auto-insert square brackets in the next service release. In the current build, they are not bound.
David
SAPIEN Technologies, Inc.

User avatar
JohnMoe
Posts: 3
Joined: Sun Apr 15, 2018 11:36 pm

Re: PowerShell Studio 2018 auto-closing error

Post by JohnMoe » Thu Aug 02, 2018 6:03 pm

Hi David,

Sorry, I just re-read what you said before and I mis-interpreted what you said. I look forward to the next release, then. :-)

Cheers,

John Moe