Author Topic: Powershell issues  (Read 280 times)

jporkkahtc

  • Senior Community Member
  • Posts: 2062
  • Hero Points: 187
  • Text
Powershell issues
« on: June 01, 2020, 08:35:40 pm »
#1: Auto-indent is too much
When entering PowerShell script, Slick appears to really want me to end each statement with a ";"

If I don't then it adds an indent level.
PowerShell I guess allows a ";", but doesn't require it. Seems uncommon it use it.
For example, here I typed in some code, only using <enter> at the end of each line, not manually indenting or un-indenting anything:

Code: [Select]
    try
        {
        Write-output "SlickEdit"
            }
    catch [Exception]
        {
            write-error "OOPS"
            }
        Write-Information "Next statement"
            Write-Information "Indented again!"
            Write-Information "But not a third time"

And again, this time I entered a ";" where appropriate at end of each line - but againb not manually indenting or un-indenting anything:
Code: [Select]
    try
        {
        write-output "Slickedit";
        }
    catch [Exception]
        {
            write-error "oops";
            }
        Write-Information "Next statement";



#2: PowerShell is now cross-platform so maybe it should be just "PowerShell", and not "Windows PowerShell".

#3: SlickEdit doesn't format embedded expressions inside strings like it does for Python
      " Hello $name "
     " The total is $(5+6)"





Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5439
  • Hero Points: 444
Re: Powershell issues
« Reply #1 on: June 02, 2020, 02:22:26 am »
#1 SlickEdit requires the semicolon. This is a limitation for now (requires full parser for syntax). Looks like the smart editing for PowerShell is pretty limited right now. There's no support for smart indenting when you type a close brace. Maybe we can improve this for v25.
#2 Already done for v25
#3 We should be able to add support for "...$(...)..." to v25. Won't change the $name case.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5439
  • Hero Points: 444
Re: Powershell issues
« Reply #2 on: June 04, 2020, 01:34:45 am »
We will improve the smart editing for PowerShell for v25 and also update the color coding.