zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
3.13k stars 203 forks source link

Add a new keyword clean that has been added in PowerShell 7.3. #768

Closed NamelessUzer closed 6 months ago

NamelessUzer commented 7 months ago

The clean block was added in PowerShell 7.3. You can find the officical document via this url https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_methods?view=powershell-7.4#clean

zufuliu commented 7 months ago

You can run KeywordUpdate.py to updated associated C source stlPowerShell.c.

It will be great if we can update cmdlet (Get-Command), alias (Get-Alias) and variable (Get-Variable) list to PowerShell 7.4 LTS. Find out new cmdlet is easy by using group_powershell_commands() (inside Misc.py) to group Get-Command output. Find out updated cmdlet in 7.3 and 7.4 will requires some time.

NamelessUzer commented 7 months ago

You can run KeywordUpdate.py to updated associated C source stlPowerShell.c.

It will be great if we can update cmdlet (Get-Command), alias (Get-Alias) and variable (Get-Variable) list to PowerShell 7.4 LTS. Find out new cmdlet is easy by using group_powershell_commands() (inside Misc.py) to group Get-Command output. Find out updated cmdlet in 7.3 and 7.4 will requires some time.

I found not only cmdlets are listed in tools\lang\powershell.ps1, but also the syntaxs for each cmdlet are listed. It really requires some time.

zufuliu commented 7 months ago

I found not only cmdlets are listed in tools\lang\powershell.ps1, but also the syntaxs for each cmdlet are listed.

Yes, people build custom version of Notepad2 can include cmdlet parameters in auto-completion data. https://github.com/zufuliu/notepad2/blob/884e303621dbfac098f0249177e19df3279177a3/tools/KeywordCore.py#L1882-L1884

Here are steps I used to update cmdlet in tools\lang\PowerShell.ps1:

  1. Download PowerShell from https://github.com/PowerShell/PowerShell/releases (e.g. PowerShell-7.4.1-win-x64.zip), run pwsh.exe and redirect Get-Command output, group the ouput with Misc.py to find out new (uncolored) cmdlets, then open Reference section to get full syntax.
  2. Read "What's new in PowerShell 7.x" to check updated cmdlets.

It really requires some time.

It's fine If you not want to spend time on updating them.

zufuliu commented 6 months ago

committed as 92c9645a3079fdfa16ea74e5f50a895f1999e13f.