Skip to content

Commit 5b34866

Browse files
committed
Merge branch 'master' of https://github.com/PowerShell/PowerShellEditorServices into PSSA_CheckInnerBraceAndPipe
2 parents 3059a14 + 4b39d01 commit 5b34866

File tree

21 files changed

+152
-84
lines changed

21 files changed

+152
-84
lines changed

PowerShellEditorServices.Common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>1.10.2</VersionPrefix>
3+
<VersionPrefix>1.10.3</VersionPrefix>
44
<Company>Microsoft</Company>
55
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
66
<PackageTags>PowerShell;editor;development;language;debugging</PackageTags>

PowerShellEditorServices.build.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ param(
2020

2121
$script:IsCIBuild = $env:APPVEYOR -ne $null
2222
$script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "Core" -and !$IsWindows
23-
$script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) { "net451;" })netstandard1.6\`""
23+
$script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) { "net452;" })netstandard1.6\`""
2424
$script:SaveModuleSupportsAllowPrerelease = (Get-Command Save-Module).Parameters.ContainsKey("AllowPrerelease")
2525
$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Host", "BuildInfo", "BuildInfo.cs")
2626

@@ -138,7 +138,7 @@ task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
138138

139139
function BuildForPowerShellVersion($version) {
140140
Write-Host -ForegroundColor Green "`n### Testing API usage for PowerShell $version...`n"
141-
exec { & $script:dotnetExe build -f net451 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj /p:PowerShellVersion=$version }
141+
exec { & $script:dotnetExe build -f net452 .\src\PowerShellEditorServices\PowerShellEditorServices.csproj /p:PowerShellVersion=$version }
142142
}
143143

144144
task TestPowerShellApi -If { !$script:IsUnix } {
@@ -198,7 +198,7 @@ namespace Microsoft.PowerShell.EditorServices.Host
198198
task Build {
199199
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f netstandard1.6 }
200200
if (!$script:IsUnix) {
201-
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f net451 }
201+
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f net452 }
202202
}
203203
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam }
204204
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f netstandard1.6 }
@@ -274,12 +274,12 @@ task LayoutModule -After Build {
274274
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\publish\runtimes\win\lib\netstandard1.3\* -Filter System.IO.Pipes*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\
275275

276276
if (!$script:IsUnix) {
277-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop
278-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\System.Runtime.InteropServices.RuntimeInformation.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
277+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net452\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop
278+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net452\System.Runtime.InteropServices.RuntimeInformation.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
279279

280-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
281-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
282-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
280+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
281+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
282+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\UnixConsoleEcho.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
283283
}
284284

285285
# Copy Third Party Notices.txt to module folder
@@ -292,7 +292,7 @@ task LayoutModule -After Build {
292292

293293
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\
294294
if (!$script:IsUnix) {
295-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
295+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net452\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
296296
}
297297

298298
if ($Configuration -eq "Debug") {
@@ -302,10 +302,10 @@ task LayoutModule -After Build {
302302
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\netstandard1.6\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\
303303

304304
if (!$script:IsUnix) {
305-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
306-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
307-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
308-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
305+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
306+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
307+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
308+
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Protocol\bin\$Configuration\net452\Microsoft.PowerShell.EditorServices.Protocol.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
309309
}
310310
}
311311
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ If you are using macOS you will need to download the latest version of OpenSSL.
6767
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
6868
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
6969
```
70-
### 2. On Windows, install the .NET 4.5.1 Targeting Pack
70+
### 2. On Windows, install the .NET 4.5.2 Targeting Pack
7171

7272
**NOTE: This is only necessary if you don't have Visual Studio installed**
7373

74-
If you try to build the code and receive an error about a missing .NET 4.5.1
74+
If you try to build the code and receive an error about a missing .NET 4.5.2
7575
Targeting Pack, you should download and install the [.NET Framework 4.5.2 Developer Pack](https://www.microsoft.com/en-us/download/details.aspx?id=42637).
7676

7777
### 3. Clone the GitHub repository:

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '1.10.2{build}'
1+
version: '1.10.3{build}'
22
image: Visual Studio 2017
33
clone_depth: 10
44
skip_tags: true

module/PowerShellEditorServices/Commands/Public/Import-EditorCommand.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function Import-EditorCommand {
115115
<# suppressOutput: #> $details.SuppressOutput,
116116
<# scriptBlock: #> $scriptBlock)
117117

118-
$PSCmdlet.WriteVerbose($Strings.EditorCommandRegistering -f $details.Name)
118+
$PSCmdlet.WriteVerbose($Strings.EditorCommandImporting -f $details.Name)
119119
$null = $psEditor.RegisterCommand($editorCommand)
120120

121121
if ($PassThru.IsPresent -and $editorCommand) {
@@ -141,4 +141,4 @@ if ($PSVersionTable.PSVersion.Major -ge 5) {
141141
[System.Management.Automation.CompletionResult]::new($PSItem, $PSItem, 'ParameterValue', $PSItem)
142142
}
143143
}
144-
}
144+
}

module/PowerShellEditorServices/PowerShellEditorServices.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PowerShellEditorServices.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.10.2'
15+
ModuleVersion = '1.10.3'
1616

1717
# ID used to uniquely identify this module
1818
GUID = '9ca15887-53a2-479a-9cda-48d26bcb6c47'

module/PowerShellEditorServices/Start-EditorServices.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,18 @@ if ($host.Runspace.LanguageMode -eq 'ConstrainedLanguage') {
161161
ExitWithError "PowerShell is configured with an unsupported LanguageMode (ConstrainedLanguage), language features are disabled."
162162
}
163163

164-
# net45 is not supported, only net451 and up
164+
# net451 and lower are not supported, only net452 and up
165165
if ($PSVersionTable.PSVersion.Major -le 5) {
166-
$net451Version = 378675
166+
$net452Version = 379893
167167
$dotnetVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\").Release
168-
if ($dotnetVersion -lt $net451Version) {
168+
if ($dotnetVersion -lt $net452Version) {
169169
Write-SessionFile @{
170170
status = failed
171171
reason = "netversion"
172172
detail = "$netVersion"
173173
}
174174

175-
ExitWithError "Your .NET version is too low. Upgrade to net451 or higher to run the PowerShell extension."
175+
ExitWithError "Your .NET version is too low. Upgrade to net452 or higher to run the PowerShell extension."
176176
}
177177
}
178178

module/docs/Find-Ast.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Find-Ast [-AtCursor] [<CommonParameters>]
2727

2828
## DESCRIPTION
2929

30-
The Find-Ast function can be used to easily find a specific AST within a script file. All ASTs following the inital starting ast will be searched, including those that are not part of the same tree.
30+
The Find-Ast function can be used to easily find a specific AST within a script file. All ASTs following the initial starting AST will be searched, including those that are not part of the same tree.
3131

3232
The behavior of the search (such as direction and criteria) can be changed with parameters.
3333

34-
Additionally, you can find the Ast closest to the cursor with the "AtCursor" switch parameter.
34+
Additionally, you can find the AST closest to the cursor with the "AtCursor" switch parameter.
3535

3636
## EXAMPLES
3737

@@ -41,23 +41,23 @@ Additionally, you can find the Ast closest to the cursor with the "AtCursor" swi
4141
Find-Ast
4242
```
4343

44-
Returns all asts in the currently open file in the editor.
44+
Returns all ASTs in the currently open file in the editor.
4545

4646
### -------------------------- EXAMPLE 2 --------------------------
4747

4848
```powershell
4949
Find-Ast -First -IncludeStartingAst
5050
```
5151

52-
Returns the top level ast in the currently open file in the editor.
52+
Returns the top level AST in the currently open file in the editor.
5353

5454
### -------------------------- EXAMPLE 3 --------------------------
5555

5656
```powershell
5757
Find-Ast { $PSItem -is [FunctionDefinitionAst] }
5858
```
5959

60-
Returns all function definition asts in the ast of file currently open in the editor.
60+
Returns all function definition ASTs in the AST of file currently open in the editor.
6161

6262
### -------------------------- EXAMPLE 4 --------------------------
6363

@@ -73,7 +73,7 @@ Returns all member expressions in the file currently open in the editor.
7373
Find-Ast { $_.InvocationOperator -eq 'Dot' } | Find-Ast -Family { $_.VariablePath }
7474
```
7575

76-
Returns all variable expressions used in a dot source expression.
76+
Returns all variable expressions used in a dot-source expression.
7777

7878
### -------------------------- EXAMPLE 6 --------------------------
7979

@@ -85,7 +85,7 @@ Find-Ast { 'PowerShellVersion' -eq $_ } |
8585

8686
This example sets the required PowerShell version in a module manifest to 4.0.
8787

88-
First it finds the AST of the PowerShellVersion manifest field, then finds the first AST directly after it and changes the text to '4.0'. This will not work as is if the field is commented.
88+
First it finds the AST of the PowerShellVersion manifest field, then finds the first AST directly after it and changes the text to '4.0'. This will not work if the field is commented.
8989

9090
### -------------------------- EXAMPLE 7 --------------------------
9191

@@ -95,7 +95,7 @@ Find-Ast { $_.ArgumentName -eq 'ParameterSetName' -and $_.Argument.Value -eq 'By
9595
ForEach-Object { $_.Name.VariablePath.UserPath }
9696
```
9797

98-
This example gets a list of all parameters that belong to the parameter set 'ByPosition'. First it uses the ArgumentName and Argument properties of NamedAttributeArgumentAst to find the ASTs of arguments to the Parameter attribute that declare the the parameter set 'ByPosition'. It then finds the closest parent ParameterAst and retrieves the name from it.
98+
This example gets a list of all parameters that belong to the 'ByPosition' parameter set. First it uses the ArgumentName and Argument properties of NamedAttributeArgumentAst to find the ASTs of arguments to the Parameter attribute that declare the 'ByPosition' parameter set. It then finds the closest parent ParameterAst and retrieves the name from it.
9999

100100
### -------------------------- EXAMPLE 8 --------------------------
101101

@@ -121,7 +121,7 @@ This example shows off ways you can combine the position functions together to g
121121

122122
### -FilterScript
123123

124-
Specifies a ScriptBlock that returns $true if an AST should be returned. Uses $PSItem and $_ like Where-Object. If not specified all ASTs will be returned.
124+
Specifies a script block that returns $true if an AST should be returned. Uses $PSItem and $_ like Where-Object. If not specified all ASTs will be returned.
125125

126126
```yaml
127127
Type: ScriptBlock
@@ -153,7 +153,7 @@ Accept wildcard characters: False
153153
154154
### -Before
155155
156-
If specified the direction of the search will be reversed.
156+
Specifies the direction of the search will be reversed.
157157
158158
```yaml
159159
Type: SwitchParameter
@@ -169,7 +169,7 @@ Accept wildcard characters: False
169169
170170
### -Family
171171
172-
If specified only children of the starting AST will be searched. If specified with the "Before" parameter then only ancestors will be searched.
172+
Searches only children of the starting AST. When used with the "Before" parameter then only ancestors will be searched.
173173
174174
```yaml
175175
Type: SwitchParameter
@@ -185,7 +185,7 @@ Accept wildcard characters: False
185185
186186
### -First
187187
188-
If specified will return only the first result. This will be the closest AST that matches.
188+
Returns only the first result. This will be the closest AST that matches.
189189
190190
```yaml
191191
Type: SwitchParameter
@@ -201,7 +201,7 @@ Accept wildcard characters: False
201201
202202
### -Last
203203
204-
If specified will return only the last result. This will be the furthest AST that matches.
204+
Returns only the last result. This will be the furthest AST that matches.
205205
206206
```yaml
207207
Type: SwitchParameter
@@ -217,7 +217,7 @@ Accept wildcard characters: False
217217
218218
### -Ancestor
219219
220-
If specified will only search ancestors of the starting AST. This is a convenience parameter that acts the same as the "Family" and "Before" parameters when used together.
220+
Searches only ancestors of the starting AST. This is a convenience parameter that acts the same as the "Family" and "Before" parameters when used together.
221221
222222
```yaml
223223
Type: SwitchParameter
@@ -233,7 +233,7 @@ Accept wildcard characters: False
233233
234234
### -IncludeStartingAst
235235
236-
If specified the starting AST will be included if matched.
236+
Specifies the starting AST will be included if matched.
237237
238238
```yaml
239239
Type: SwitchParameter
@@ -249,7 +249,7 @@ Accept wildcard characters: False
249249
250250
### -AtCursor
251251
252-
If specified, this function will return the smallest AST that the cursor is within.
252+
Returns the smallest AST that the cursor is within.
253253
254254
```yaml
255255
Type: SwitchParameter

module/docs/PowerShellEditorServices.Commands.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ The ConvertFrom-ScriptExtent function converts ScriptExtent objects to types use
2020

2121
### [ConvertTo-ScriptExtent](ConvertTo-ScriptExtent.md)
2222

23-
The ConvertTo-ScriptExtent function can be used to convert any object with position related properties to a ScriptExtent object. You can also specify the parameters directly to manually create ScriptExtent objects.
23+
The ConvertTo-ScriptExtent function can be used to convert any object with position-related properties to a ScriptExtent object. You can also specify the parameters directly to manually create ScriptExtent objects.
2424

2525
### [Find-Ast](Find-Ast.md)
2626

27-
The Find-Ast function can be used to easily find a specific AST within a script file. All ASTs following the inital starting ast will be searched, including those that are not part of the same tree.
27+
The Find-Ast function can be used to easily find a specific AST within a script file. All ASTs following the initial starting AST will be searched, including those that are not part of the same tree.
2828

2929
### [Get-Token](Get-Token.md)
3030

31-
The Get-Token function can retrieve tokens from the current editor context, or from a ScriptExtent object. You can then use the ScriptExtent functions to manipulate the text at it's location.
31+
The Get-Token function can retrieve tokens from the current editor context, or from a ScriptExtent object. You can then use the ScriptExtent functions to manipulate the text at its location.
3232

3333
### [Import-EditorCommand](Import-EditorCommand.md)
3434

@@ -38,7 +38,7 @@ Alternatively, you can specify command info objects (like those from the Get-Com
3838

3939
### [Join-ScriptExtent](Join-ScriptExtent.md)
4040

41-
The Join-ScriptExtent function will combine all ScriptExtent objects piped to it into a single extent. This can be used combine multiple ASTs, tokens, or other script elements into a single object that can then be manipulated or used for more targeted searches.
41+
The Join-ScriptExtent function will combine all ScriptExtent objects piped to it into a single extent. This can be used to combine multiple ASTs, tokens, or other script elements into a single object that can then be manipulated or used for more targeted searches.
4242

4343
### [Set-ScriptExtent](Set-ScriptExtent.md)
4444

0 commit comments

Comments
 (0)