Skip to content

Commit 2c0b076

Browse files
committed
Merge branch 'updateNuget' of https://github.com/bergmeister/PowerShellEditorServices into updateNuget
2 parents 7a9e730 + 9d2c528 commit 2c0b076

File tree

23 files changed

+191
-95
lines changed

23 files changed

+191
-95
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# PowerShell Editor Services Release History
22

3+
## v1.10.2
4+
### Tuesday, December 18, 2018
5+
6+
- [PowerShellEditorServices #811](https://github.com/PowerShell/PowerShellEditorServices/pull/805) -
7+
Fix token-based folding (thanks @glennsarti!)
8+
- [PowerShellEditorServices #823](https://github.com/PowerShell/PowerShellEditorServices/pull/823) -
9+
Fix case-sensitivity of Pester CodeLens (thanks @bergmeister!)
10+
- [PowerShellEditorServices #815](https://github.com/PowerShell/PowerShellEditorServices/pull/815) -
11+
Fix crash when untitled files opened as PowerShell
12+
- [PowerShellEditorServices #826](https://github.com/PowerShell/PowerShellEditorServices/pull/826) -
13+
Fix crash when duplicate references are present in the same file
14+
315
## v1.10.1
416
### Friday, December 7, 2018
517

PowerShellEditorServices.Common.props

+1-1
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

+24-17
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ param(
1111

1212
[string]$ModulesJsonPath = "$PSScriptRoot/modules.json",
1313

14-
[string]$DefaultModuleRepository = "PSGallery"
14+
[string]$DefaultModuleRepository = "PSGallery",
15+
16+
[string]$TestFilter = ''
1517
)
1618

1719
#Requires -Modules @{ModuleName="InvokeBuild";ModuleVersion="3.2.1"}
1820

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

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

137139
function BuildForPowerShellVersion($version) {
138140
Write-Host -ForegroundColor Green "`n### Testing API usage for PowerShell $version...`n"
139-
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 }
140142
}
141143

142144
task TestPowerShellApi -If { !$script:IsUnix } {
@@ -196,7 +198,7 @@ namespace Microsoft.PowerShell.EditorServices.Host
196198
task Build {
197199
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f netstandard1.6 }
198200
if (!$script:IsUnix) {
199-
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 }
200202
}
201203
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam }
202204
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f netstandard1.6 }
@@ -223,24 +225,29 @@ function UploadTestLogs {
223225
}
224226
}
225227

228+
function XunitTraitFilter {
229+
# Reference https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests
230+
if ($TestFilter) { "-trait $TestFilter" } else { "" }
231+
}
232+
226233
task Test TestServer,TestProtocol
227234

228235
task TestServer -If { !$script:IsUnix } {
229236
Set-Location .\test\PowerShellEditorServices.Test\
230237
exec { & $script:dotnetExe build -c $Configuration -f net452 }
231-
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild }
238+
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild (XunitTraitFilter) }
232239
}
233240

234241
task TestProtocol -If { !$script:IsUnix } {
235242
Set-Location .\test\PowerShellEditorServices.Test.Protocol\
236243
exec { & $script:dotnetExe build -c $Configuration -f net452 }
237-
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild }
244+
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild (XunitTraitFilter) }
238245
}
239246

240247
task TestHost -If { !$script:IsUnix } {
241248
Set-Location .\test\PowerShellEditorServices.Test.Host\
242249
exec { & $script:dotnetExe build -c $Configuration -f net452 }
243-
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild }
250+
exec { & $script:dotnetExe xunit -configuration $Configuration -framework net452 -verbose -nobuild (XunitTraitFilter) }
244251
}
245252

246253
task CITest ?Test, {
@@ -267,12 +274,12 @@ task LayoutModule -After Build {
267274
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\
268275

269276
if (!$script:IsUnix) {
270-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Serilog*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop
271-
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\
272279

273-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
274-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
275-
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\
276283
}
277284

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

286293
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\
287294
if (!$script:IsUnix) {
288-
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\
289296
}
290297

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

297304
if (!$script:IsUnix) {
298-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.VSCode.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\
299-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
300-
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Microsoft.PowerShell.EditorServices.Host.pdb -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\
301-
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\
302309
}
303310
}
304311
}

README.md

+2-2
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

+1-1
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

+2-2
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

+1-1
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

+4-4
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

+16-16
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

0 commit comments

Comments
 (0)