Skip to content

Commit efd884f

Browse files
author
Kapil Borle
committed
Fix merge conflict in LanguageServer.cs
2 parents 0ebfb5e + 772383b commit efd884f

File tree

89 files changed

+4813
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+4813
-341
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ PowerShellEditorServices.sln.ide/edb.chk
5959
PowerShellEditorServices.sln.ide/edbres00001.jrs
6060
PowerShellEditorServices.sln.ide/storage.ide
6161
*.jrs
62+
63+
# Don't include PlatyPS generated MAML
64+
module/PowerShellEditorServices/Commands/en-US/*-help.xml

CHANGELOG.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,130 @@
11
# PowerShell Editor Services Release History
22

3+
## 1.3.2
4+
### Monday, June 12, 2017
5+
6+
- [PowerShell/vscode-powershell#857](https://github.com/PowerShell/vscode-powershell/issues/855) - Typing a new function into a file no longer causes the language server to crash
7+
8+
- [PowerShell/vscode-powershell#855](https://github.com/PowerShell/vscode-powershell/issues/855) - "Format Document" no longer hangs indefinitely
9+
10+
- [PowerShell/vscode-powershell#859](https://github.com/PowerShell/vscode-powershell/issues/859) - Language server no longer hangs when opening a Pester test file containing dot-sourced script references
11+
12+
- [PowerShell/vscode-powershell#856](https://github.com/PowerShell/vscode-powershell/issues/856) - CodeLenses for function definitions no longer count the definition itself as a reference and shows "0 references" when there are no uses of that function
13+
14+
- [PowerShell/vscode-powershell#838](https://github.com/PowerShell/vscode-powershell/issues/838) - Right-clicking a debugger variable and selecting "Add to Watch" now has the desired result
15+
16+
- [PowerShell/vscode-powershell#837](https://github.com/PowerShell/vscode-powershell/issues/837) - Debugger call stack now navigates correctly to the user's selected stack frame
17+
18+
- [PowerShell/vscode-powershell#862](https://github.com/PowerShell/vscode-powershell/issues/862) - Terminating errors in the language server now close the Integrated Console immediately and prompt the user to restart the session
19+
20+
- [PowerShell/PowerShellEditorServices#505](https://github.com/PowerShell/PowerShellEditorServices/issues/505) - Added improved cmdlet help in the PowerShellEditorServices.Commands module
21+
22+
- [PowerShell/PowerShellEditorServices#509](https://github.com/PowerShell/PowerShellEditorServices/issues/509) - Importing the PowerShellEditorServices.Commands module no longer causes errors to be written about missing help languages
23+
24+
## 1.3.1
25+
### Friday, June 9, 2017
26+
27+
#### Fixes and improvements
28+
29+
- [PowerShell/vscode-powershell#850](https://github.com/PowerShell/vscode-powershell/issues/850) -
30+
Fixed an issue where lower-cased "describe" blocks were not identified by
31+
the CodeLens feature.
32+
33+
- [PowerShell/vscode-powershell#851](https://github.com/PowerShell/vscode-powershell/issues/851) -
34+
Fixed an issue where the language server would hang when typing out a describe
35+
block.
36+
37+
- [PowerShell/vscode-powershell#852](https://github.com/PowerShell/vscode-powershell/issues/852) -
38+
Fixed an issue where Pester test names would not be detected correctly when
39+
other arguments like -Tags were being used on a Describe block.
40+
41+
## 1.3.0
42+
### Friday, June 9, 2017
43+
44+
#### Notice of new internal redesign ([#484](https://github.com/PowerShell/PowerShellEditorServices/pull/484), [#488](https://github.com/PowerShell/PowerShellEditorServices/pull/488), [#489](https://github.com/PowerShell/PowerShellEditorServices/pull/489))
45+
46+
This release marks the start of a major redesign of the core PowerShell
47+
Editor Services APIs, PSHost implementation, and service model. Most of
48+
these changes will be transparent to the language and debugging services
49+
so there shouldn't be any major breaking changes.
50+
51+
The goal is to quickly design and validate a new extensibility model that
52+
allows IFeatureProvider implementations to extend focused feature components
53+
which could be a part of PowerShell Editor Services or another extension
54+
module. As we progress, certain features may move out of the core Editor
55+
Services module into satellite modules. This will allow our functionality
56+
to be much more flexible and provide extensions with the same set of
57+
capabilities that built-in features have.
58+
59+
We are moving toward a 2.0 release of the core PowerShell Editor Services
60+
APIs over the next few months once this new design has been validated and
61+
stabilized. We'll produce updated API documentation as we move closer
62+
to 2.0.
63+
64+
#### New document symbol and CodeLens features ([#490](https://github.com/PowerShell/PowerShellEditorServices/pull/490), [#497](https://github.com/PowerShell/PowerShellEditorServices/pull/497), [#498](https://github.com/PowerShell/PowerShellEditorServices/pull/498))
65+
66+
As part of our new extensibility model work, we've added two new components
67+
which follow the new "feature and provider" model which we'll be moving
68+
all other features to soon.
69+
70+
The IDocumentSymbols feature component provides a list of symbols for a
71+
given document. It relies on the results provided by a collection of
72+
IDocumentSymbolProvider implementations which can come from any module.
73+
We've added the following built-in IDocumentSymbolProvider implementations:
74+
75+
- ScriptDocumentSymbolProvider: Provides symbols for function and command
76+
definitions in .ps1 and .psm1 files
77+
- PsdDocumentSymbolProvider: Provides symbols for keys in .psd1 files
78+
- PesterDocumentSymbolProvider: Provides symbols for Describe, Context, and
79+
It blocks in Pester test scripts
80+
81+
We took a similar approach to developing an ICodeLenses feature component
82+
which retrieves a list of CodeLenses which get displayed in files to provide
83+
visible actions embedded into the code. We used this design to add the
84+
following built-in ICodeLensProvider implementations:
85+
86+
- ReferencesCodeLensProvider: Shows CodeLenses like "3 references" to indicate
87+
the number of references to a given function or command
88+
- PesterCodeLensProvider: Shows "Run tests" and "Debug tests" CodeLenses on
89+
Pester Describe blocks in test script files allowing the user to easily
90+
run and debug those tests
91+
92+
Note that the ICodeLensProvider and IDocumentSymbolProvider interfaces are
93+
not fully stable yet but we encourage you to try using them so that you can
94+
give us your feedback!
95+
96+
#### Added a new PowerShellEditorServices.Commands module (#[487](https://github.com/PowerShell/PowerShellEditorServices/pull/487), #[496](https://github.com/PowerShell/PowerShellEditorServices/pull/496))
97+
98+
We've added a new Commands module that gets loaded inside of PowerShell Editor
99+
Services to provide useful functionality when the $psEditor API is available.
100+
101+
Thanks to our new co-maintainer [Patrick Meinecke](https://github.com/SeeminglyScience),
102+
we've gained a new set of useful commands for interacting with the $psEditor APIs
103+
within the Integrated Console:
104+
105+
- [Find-Ast](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Find-Ast.md)
106+
- [Get-Token](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Get-Token.md)
107+
- [ConvertFrom-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/ConvertFrom-ScriptExtent.md)
108+
- [ConvertTo-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/ConvertTo-ScriptExtent.md)
109+
- [Set-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Set-ScriptExtent.md)
110+
- [Join-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Join-ScriptExtent.md)
111+
- [Test-ScriptExtent](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Test-ScriptExtent.md)
112+
- [Import-EditorCommand](https://github.com/PowerShell/PowerShellEditorServices/blob/master/module/docs/Import-EditorCommand.md)
113+
114+
#### Microsoft.PowerShell.EditorServices API removals ([#492](https://github.com/PowerShell/PowerShellEditorServices/pull/492))
115+
116+
We've removed the following classes and interfaces which were previously
117+
considered public APIs in the core Editor Services assembly:
118+
119+
- ConsoleService and IConsoleHost: We now centralize our host interface
120+
implementations under the standard PSHostUserInterface design.
121+
- IPromptHandlerContext: We no longer have the concept of "prompt handler
122+
contexts." Each PSHostUserInterface implementation now has one way of
123+
displaying console-based prompts to the user. New editor window prompting
124+
APIs will be added for the times when a UI is needed.
125+
- Logger: now replaced by a new non-static ILogger instance which can be
126+
requested by extensions through the IComponentRegistry.
127+
3128
## 1.2.1
4129
### Thursday, June 1, 2017
5130

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.2.1</VersionPrefix>
3+
<VersionPrefix>1.3.2</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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ task Clean {
100100
Remove-Item .\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore
101101
Get-ChildItem -Recurse src\*.nupkg | Remove-Item -Force -ErrorAction Ignore
102102
Get-ChildItem .\module\PowerShellEditorServices\*.zip | Remove-Item -Force -ErrorAction Ignore
103+
Get-ChildItem .\module\PowerShellEditorServices\Commands\en-US\*-help.xml | Remove-Item -Force -ErrorAction Ignore
103104
}
104105

105106
task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
@@ -198,6 +199,10 @@ task LayoutModule -After Build {
198199
Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\
199200
}
200201

202+
task BuildCmdletHelp {
203+
New-ExternalHelp -Path $PSScriptRoot\module\docs -OutputPath $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US -Force
204+
}
205+
201206
task PackageNuGet {
202207
exec { & $script:dotnetExe pack -c $Configuration --version-suffix $script:VersionSuffix .\src\PowerShellEditorServices\PowerShellEditorServices.csproj $script:TargetFrameworksParam }
203208
exec { & $script:dotnetExe pack -c $Configuration --version-suffix $script:VersionSuffix .\src\PowerShellEditorServices.Protocol\PowerShellEditorServices.Protocol.csproj $script:TargetFrameworksParam }
@@ -222,4 +227,4 @@ task UploadArtifacts -If ($script:IsCIBuild) {
222227
}
223228

224229
# The default task is to run the entire CI build
225-
task . GetProductVersion, Clean, Build, TestPowerShellApi, CITest, PackageNuGet, PackageModule, UploadArtifacts
230+
task . GetProductVersion, Clean, Build, TestPowerShellApi, CITest, BuildCmdletHelp, PackageNuGet, PackageModule, UploadArtifacts

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '1.2.1.{build}'
1+
version: '1.3.2.{build}'
22
image: Visual Studio 2017
33
clone_depth: 10
44
skip_tags: true
@@ -13,11 +13,11 @@ environment:
1313

1414
install:
1515
- ps: |
16-
1716
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
1817
Import-PackageProvider NuGet -Force | Out-Null
1918
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null
2019
Install-Module InvokeBuild -RequiredVersion 3.2.1 -Scope CurrentUser -Force | Out-Null
20+
Install-Module platyPS -RequiredVersion 0.7.6 -Scope CurrentUser -Force | Out-Null
2121
2222
build_script:
2323
- ps: Invoke-Build -Configuration Release

module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
RootModule = 'PowerShellEditorServices.Commands.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.0'
15+
ModuleVersion = '0.1.1'
1616

1717
# ID used to uniquely identify this module
18-
GUID = '9ca15887-53a2-479a-9cda-48d26bcb6c47'
18+
GUID = '6064d846-0fa0-4b6d-afc1-11e5bed3c4a9'
1919

2020
# Author of this module
2121
Author = 'Microsoft'
@@ -57,7 +57,7 @@ Description = 'Provides internal commands for PowerShell Editor Services that on
5757
# ScriptsToProcess = @()
5858

5959
# Type files (.ps1xml) to be loaded when importing this module
60-
# TypesToProcess = @()
60+
TypesToProcess = @('PowerShellEditorServices.Commands.types.ps1xml')
6161

6262
# Format files (.ps1xml) to be loaded when importing this module
6363
# FormatsToProcess = @()
@@ -66,7 +66,17 @@ Description = 'Provides internal commands for PowerShell Editor Services that on
6666
# NestedModules = @()
6767

6868
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
69-
FunctionsToExport = @('Register-EditorCommand', 'Unregister-EditorCommand')
69+
FunctionsToExport = @('Register-EditorCommand',
70+
'Unregister-EditorCommand',
71+
'Set-ScriptExtent',
72+
'Find-Ast',
73+
'Import-EditorCommand',
74+
'ConvertFrom-ScriptExtent',
75+
'ConvertTo-ScriptExtent',
76+
'Get-Token',
77+
'Join-ScriptExtent',
78+
'Test-ScriptExtent',
79+
'psedit')
7080

7181
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7282
CmdletsToExport = @()
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore
12

2-
# TODO: Use a better script loading process here
3-
. $PSScriptRoot\Public\CmdletInterface.ps1
3+
Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
4+
. $PSItem.FullName
5+
}
6+
7+
Export-ModuleMember -Function *-*
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Types>
3+
<Type>
4+
<Name>Microsoft.PowerShell.EditorServices.FullScriptExtent</Name>
5+
<Members>
6+
<MemberSet>
7+
<Name>PSStandardMembers</Name>
8+
<Members>
9+
<PropertySet>
10+
<Name>DefaultDisplayPropertySet</Name>
11+
<ReferencedProperties>
12+
<Name>File</Name>
13+
<Name>StartScriptPosition</Name>
14+
<Name>EndScriptPosition</Name>
15+
<Name>StartLineNumber</Name>
16+
<Name>StartColumnNumber</Name>
17+
<Name>EndLineNumber</Name>
18+
<Name>EndColumnNumber</Name>
19+
<Name>StartOffset</Name>
20+
<Name>EndOffset</Name>
21+
<Name>Text</Name>
22+
</ReferencedProperties>
23+
</PropertySet>
24+
</Members>
25+
</MemberSet>
26+
</Members>
27+
</Type>
28+
</Types>

module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,5 @@
11
<#
2-
.SYNOPSIS
3-
Registers a command which can be executed in the host editor.
4-
5-
.DESCRIPTION
6-
Registers a command which can be executed in the host editor. This
7-
command will be shown to the user either in a menu or command palette.
8-
Upon invoking this command, either a function/cmdlet or ScriptBlock will
9-
be executed depending on whether the -Function or -ScriptBlock parameter
10-
was used when the command was registered.
11-
12-
This command can be run multiple times for the same command so that its
13-
details can be updated. However, re-registration of commands should only
14-
be used for development purposes, not for dynamic behavior.
15-
16-
.PARAMETER Name
17-
Specifies a unique name which can be used to identify this command.
18-
This name is not displayed to the user.
19-
20-
.PARAMETER DisplayName
21-
Specifies a display name which is displayed to the user.
22-
23-
.PARAMETER Function
24-
Specifies a function or cmdlet name which will be executed when the user
25-
invokes this command. This function may take a parameter called $context
26-
which will be populated with an EditorContext object containing information
27-
about the host editor's state at the time the command was executed.
28-
29-
.PARAMETER ScriptBlock
30-
Specifies a ScriptBlock which will be executed when the user invokes this
31-
command. This ScriptBlock may take a parameter called $context
32-
which will be populated with an EditorContext object containing information
33-
about the host editor's state at the time the command was executed.
34-
35-
.PARAMETER SuppressOutput
36-
If provided, causes the output of the editor command to be suppressed when
37-
it is run. Errors that occur while running this command will still be
38-
written to the host.
39-
40-
.EXAMPLE
41-
PS> Register-EditorCommand -Name "MyModule.MyFunctionCommand" -DisplayName "My function command" -Function Invoke-MyCommand -SuppressOutput
42-
43-
.EXAMPLE
44-
PS> Register-EditorCommand -Name "MyModule.MyScriptBlockCommand" -DisplayName "My ScriptBlock command" -ScriptBlock { Write-Output "Hello from my command!" }
45-
46-
.LINK
47-
Unregister-EditorCommand
2+
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
483
#>
494
function Register-EditorCommand {
505
[CmdletBinding()]
@@ -100,21 +55,7 @@ function Register-EditorCommand {
10055
}
10156

10257
<#
103-
.SYNOPSIS
104-
Unregisters a command which has already been registered in the host editor.
105-
106-
.DESCRIPTION
107-
Unregisters a command which has already been registered in the host editor.
108-
An error will be thrown if the specified Name is unknown.
109-
110-
.PARAMETER Name
111-
Specifies a unique name which identifies a command which has already been registered.
112-
113-
.EXAMPLE
114-
PS> Unregister-EditorCommand -Name "MyModule.MyFunctionCommand"
115-
116-
.LINK
117-
Register-EditorCommand
58+
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
11859
#>
11960
function Unregister-EditorCommand {
12061
[CmdletBinding()]
@@ -138,3 +79,4 @@ function psedit {
13879
$psEditor.Workspace.OpenFile($_.FullName)
13980
}
14081
}
82+
Export-ModuleMember -Function psedit

0 commit comments

Comments
 (0)