diff --git a/.gitignore b/.gitignore
index 3567788f8..8d18bc259 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,7 +37,7 @@ docs/metadata/
*.zip
# Generated build info file
-src/PowerShellEditorServices.Host/BuildInfo/BuildInfo.cs
+src/PowerShellEditorServices/Hosting/BuildInfo.cs
# quickbuild.exe
/VersionGeneratingLogs/
@@ -67,6 +67,7 @@ PowerShellEditorServices.sln.ide/storage.ide
# Don't include PlatyPS generated MAML
module/PowerShellEditorServices/Commands/en-US/*-help.xml
+module/PowerShellEditorServices.VSCode/en-US/*-help.xml
# Don't include Third Party Notices in module folder
module/PowerShellEditorServices/Third\ Party\ Notices.txt
diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml
index 905802378..0ccaff133 100644
--- a/.vsts-ci/templates/ci-general.yml
+++ b/.vsts-ci/templates/ci-general.yml
@@ -23,3 +23,4 @@ steps:
inputs:
ArtifactName: PowerShellEditorServices-CI
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
+ condition: succeededOrFailed()
diff --git a/NuGet.Config b/NuGet.Config
index 6efc7f7b9..2f64451ed 100644
--- a/NuGet.Config
+++ b/NuGet.Config
@@ -3,4 +3,8 @@
+
+
+
+
diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1
index 91046afb7..aa32c403e 100644
--- a/PowerShellEditorServices.build.ps1
+++ b/PowerShellEditorServices.build.ps1
@@ -22,13 +22,12 @@ $script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "C
$script:TargetPlatform = "netstandard2.0"
$script:TargetFrameworksParam = "/p:TargetFrameworks=`"$script:TargetPlatform`""
$script:RequiredSdkVersion = (Get-Content (Join-Path $PSScriptRoot 'global.json') | ConvertFrom-Json).sdk.version
-$script:MinimumPesterVersion = '4.7'
$script:NugetApiUriBase = 'https://www.nuget.org/api/v2/package'
$script:ModuleBinPath = "$PSScriptRoot/module/PowerShellEditorServices/bin/"
$script:VSCodeModuleBinPath = "$PSScriptRoot/module/PowerShellEditorServices.VSCode/bin/"
$script:WindowsPowerShellFrameworkTarget = 'net461'
$script:NetFrameworkPlatformId = 'win'
-$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices.Host", "BuildInfo", "BuildInfo.cs")
+$script:BuildInfoPath = [System.IO.Path]::Combine($PSScriptRoot, "src", "PowerShellEditorServices", "Hosting", "BuildInfo.cs")
$script:PSCoreModulePath = $null
@@ -52,27 +51,28 @@ Schema is:
$script:RequiredBuildAssets = @{
$script:ModuleBinPath = @{
'PowerShellEditorServices' = @(
- 'publish/Serilog.dll',
- 'publish/Serilog.Sinks.Async.dll',
- 'publish/Serilog.Sinks.Console.dll',
- 'publish/Serilog.Sinks.File.dll',
+ 'publish/Microsoft.Extensions.DependencyInjection.Abstractions.dll',
+ 'publish/Microsoft.Extensions.DependencyInjection.dll',
'publish/Microsoft.Extensions.FileSystemGlobbing.dll',
- 'Microsoft.PowerShell.EditorServices.dll',
- 'Microsoft.PowerShell.EditorServices.pdb'
- )
-
- 'PowerShellEditorServices.Host' = @(
- 'publish/UnixConsoleEcho.dll',
- 'publish/runtimes/osx-64/native/libdisablekeyecho.dylib',
- 'publish/runtimes/linux-64/native/libdisablekeyecho.so',
+ 'publish/Microsoft.Extensions.Logging.Abstractions.dll',
+ 'publish/Microsoft.Extensions.Logging.dll',
+ 'publish/Microsoft.Extensions.Options.dll',
+ 'publish/Microsoft.Extensions.Primitives.dll',
+ 'publish/Microsoft.PowerShell.EditorServices.dll',
+ 'publish/Microsoft.PowerShell.EditorServices.pdb',
'publish/Newtonsoft.Json.dll',
- 'Microsoft.PowerShell.EditorServices.Host.dll',
- 'Microsoft.PowerShell.EditorServices.Host.pdb'
- )
-
- 'PowerShellEditorServices.Protocol' = @(
- 'Microsoft.PowerShell.EditorServices.Protocol.dll',
- 'Microsoft.PowerShell.EditorServices.Protocol.pdb'
+ 'publish/OmniSharp.Extensions.JsonRpc.dll',
+ 'publish/OmniSharp.Extensions.LanguageProtocol.dll',
+ 'publish/OmniSharp.Extensions.LanguageServer.dll',
+ 'publish/OmniSharp.Extensions.DebugAdapter.dll',
+ 'publish/OmniSharp.Extensions.DebugAdapter.Server.dll',
+ 'publish/runtimes/linux-64/native/libdisablekeyecho.so',
+ 'publish/runtimes/osx-64/native/libdisablekeyecho.dylib',
+ 'publish/Serilog.dll',
+ 'publish/Serilog.Extensions.Logging.dll',
+ 'publish/Serilog.Sinks.File.dll',
+ 'publish/System.Reactive.dll',
+ 'publish/UnixConsoleEcho.dll'
)
}
@@ -102,12 +102,6 @@ $script:RequiredNugetBinaries = @{
@{ PackageName = 'System.Security.AccessControl'; PackageVersion = '4.5.0'; TargetRuntime = 'net461' },
@{ PackageName = 'System.IO.Pipes.AccessControl'; PackageVersion = '4.5.1'; TargetRuntime = 'net461' }
)
-
- '6.0' = @(
- @{ PackageName = 'System.Security.Principal.Windows'; PackageVersion = '4.5.0'; TargetRuntime = 'netcoreapp2.0' },
- @{ PackageName = 'System.Security.AccessControl'; PackageVersion = '4.5.0'; TargetRuntime = 'netcoreapp2.0' },
- @{ PackageName = 'System.IO.Pipes.AccessControl'; PackageVersion = '4.5.1'; TargetRuntime = 'netstandard2.0' }
- )
}
if (Get-Command git -ErrorAction SilentlyContinue) {
@@ -180,7 +174,7 @@ function Invoke-WithCreateDefaultHook {
}
}
-task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, PackageNuGet {
+task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestE2E {
$dotnetPath = "$PSScriptRoot/.dotnet"
$dotnetExePath = if ($script:IsUnix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" }
@@ -259,7 +253,7 @@ task Clean {
Get-ChildItem $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US\*-help.xml | Remove-Item -Force -ErrorAction Ignore
}
-task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
+task GetProductVersion -Before PackageModule, UploadArtifacts {
[xml]$props = Get-Content .\PowerShellEditorServices.Common.props
$script:BuildNumber = 9999
@@ -310,7 +304,7 @@ task CreateBuildInfo -Before Build {
[string]$buildTime = [datetime]::Now.ToString("s", [System.Globalization.CultureInfo]::InvariantCulture)
$buildInfoContents = @"
-namespace Microsoft.PowerShell.EditorServices.Host
+namespace Microsoft.PowerShell.EditorServices.Hosting
{
public static class BuildInfo
{
@@ -326,21 +320,16 @@ namespace Microsoft.PowerShell.EditorServices.Host
task Build {
exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices\PowerShellEditorServices.csproj -f $script:TargetPlatform }
- exec { & $script:dotnetExe publish -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj -f $script:TargetPlatform }
exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam }
}
-task BuildPsesClientModule SetupDotNet,{
- Write-Verbose 'Building PsesPsClient testing module'
- & $PSScriptRoot/tools/PsesPsClient/build.ps1 -DotnetExe $script:dotnetExe
-}
-
function DotNetTestFilter {
# Reference https://docs.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests
if ($TestFilter) { @("--filter",$TestFilter) } else { "" }
}
-task Test TestServer,TestProtocol,TestPester
+# task Test TestServer,TestProtocol,TestE2E
+task Test TestE2E
task TestServer {
Set-Location .\test\PowerShellEditorServices.Test\
@@ -378,26 +367,11 @@ task TestHost {
exec { & $script:dotnetExe test -f $script:TestRuntime.Core (DotNetTestFilter) }
}
-task TestPester Build,BuildPsesClientModule,EnsurePesterInstalled,{
- $testParams = @{}
- if ($env:TF_BUILD)
- {
- $testParams += @{
- OutputFormat = 'NUnitXml'
- OutputFile = 'TestResults.xml'
- }
- }
- $result = Invoke-Pester "$PSScriptRoot/test/Pester/" @testParams -PassThru
+task TestE2E {
+ Set-Location .\test\PowerShellEditorServices.Test.E2E\
- if ($result.FailedCount -gt 0)
- {
- throw "$($result.FailedCount) tests failed."
- }
-}
-
-task EnsurePesterInstalled -If (-not (Get-Module Pester -ListAvailable | Where-Object Version -ge $script:MinimumPesterVersion)) {
- Write-Warning "Required Pester version not found, installing Pester to current user scope"
- Install-Module -Scope CurrentUser Pester -Force -SkipPublisherCheck
+ $env:PWSH_EXE_NAME = if ($IsCoreCLR) { "pwsh" } else { "powershell" }
+ exec { & $script:dotnetExe test --logger trx -f $script:TestRuntime.Core (DotNetTestFilter) }
}
task LayoutModule -After Build {
@@ -502,12 +476,7 @@ task RestorePsesModules -After Build {
task BuildCmdletHelp {
New-ExternalHelp -Path $PSScriptRoot\module\docs -OutputPath $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US -Force
-}
-
-task PackageNuGet {
- exec { & $script:dotnetExe pack -c $Configuration --version-suffix $script:VersionSuffix .\src\PowerShellEditorServices\PowerShellEditorServices.csproj $script:TargetFrameworksParam }
- exec { & $script:dotnetExe pack -c $Configuration --version-suffix $script:VersionSuffix .\src\PowerShellEditorServices.Protocol\PowerShellEditorServices.Protocol.csproj $script:TargetFrameworksParam }
- exec { & $script:dotnetExe pack -c $Configuration --version-suffix $script:VersionSuffix .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj $script:TargetFrameworksParam }
+ New-ExternalHelp -Path $PSScriptRoot\module\PowerShellEditorServices.VSCode\docs -OutputPath $PSScriptRoot\module\PowerShellEditorServices.VSCode\en-US -Force
}
task PackageModule {
@@ -523,4 +492,4 @@ task UploadArtifacts -If ($null -ne $env:TF_BUILD) {
}
# The default task is to run the entire CI build
-task . GetProductVersion, Clean, Build, Test, BuildCmdletHelp, PackageNuGet, PackageModule, UploadArtifacts
+task . GetProductVersion, Clean, Build, Test, BuildCmdletHelp, PackageModule, UploadArtifacts
diff --git a/PowerShellEditorServices.sln b/PowerShellEditorServices.sln
index 6c3671bb0..30c954422 100644
--- a/PowerShellEditorServices.sln
+++ b/PowerShellEditorServices.sln
@@ -7,10 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F594E7FD-1E7
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{422E561A-8118-4BE7-A54F-9309E4F03AAE}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices", "src\PowerShellEditorServices\PowerShellEditorServices.csproj", "{81E8CBCD-6319-49E7-9662-0475BD0791F4}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Host", "src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj", "{B2F6369A-D737-4AFD-8B81-9B094DB07DA7}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Test.Host", "test\PowerShellEditorServices.Test.Host\PowerShellEditorServices.Test.Host.csproj", "{3A5DDD20-5BD0-42F4-89F4-ACC0CE554028}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Test", "test\PowerShellEditorServices.Test\PowerShellEditorServices.Test.csproj", "{8ED116F4-9DDF-4C49-AB96-AE462E3D64C3}"
@@ -22,12 +18,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{E231
scripts\AddCopyrightHeaders.ps1 = scripts\AddCopyrightHeaders.ps1
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Protocol", "src\PowerShellEditorServices.Protocol\PowerShellEditorServices.Protocol.csproj", "{F8A0946A-5D25-4651-8079-B8D5776916FB}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Test.Protocol", "test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj", "{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.VSCode", "src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj", "{3B38E8DA-8BFF-4264-AF16-47929E6398A3}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices", "src\PowerShellEditorServices\PowerShellEditorServices.csproj", "{29EEDF03-0990-45F4-846E-2616970D1FA2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Test.E2E", "test\PowerShellEditorServices.Test.E2E\PowerShellEditorServices.Test.E2E.csproj", "{2561F253-8F72-436A-BCC3-AA63AB82EDC0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -38,30 +36,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|x64.ActiveCfg = Debug|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|x64.Build.0 = Debug|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|x86.ActiveCfg = Debug|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|x86.Build.0 = Debug|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|Any CPU.Build.0 = Release|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|x64.ActiveCfg = Release|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|x64.Build.0 = Release|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|x86.ActiveCfg = Release|Any CPU
- {81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|x86.Build.0 = Release|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Debug|x64.ActiveCfg = Debug|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Debug|x64.Build.0 = Debug|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Debug|x86.ActiveCfg = Debug|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Debug|x86.Build.0 = Debug|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Release|Any CPU.Build.0 = Release|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Release|x64.ActiveCfg = Release|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Release|x64.Build.0 = Release|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Release|x86.ActiveCfg = Release|Any CPU
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7}.Release|x86.Build.0 = Release|Any CPU
{3A5DDD20-5BD0-42F4-89F4-ACC0CE554028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A5DDD20-5BD0-42F4-89F4-ACC0CE554028}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A5DDD20-5BD0-42F4-89F4-ACC0CE554028}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -98,18 +72,6 @@ Global
{6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA}.Release|x64.Build.0 = Release|Any CPU
{6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA}.Release|x86.ActiveCfg = Release|Any CPU
{6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA}.Release|x86.Build.0 = Release|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Debug|x64.ActiveCfg = Debug|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Debug|x64.Build.0 = Debug|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Debug|x86.ActiveCfg = Debug|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Debug|x86.Build.0 = Debug|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Release|Any CPU.Build.0 = Release|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Release|x64.ActiveCfg = Release|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Release|x64.Build.0 = Release|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Release|x86.ActiveCfg = Release|Any CPU
- {F8A0946A-5D25-4651-8079-B8D5776916FB}.Release|x86.Build.0 = Release|Any CPU
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -134,18 +96,41 @@ Global
{3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x64.Build.0 = Release|Any CPU
{3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x86.ActiveCfg = Release|Any CPU
{3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x86.Build.0 = Release|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Debug|x64.Build.0 = Debug|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Debug|x86.Build.0 = Debug|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Release|x64.ActiveCfg = Release|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Release|x64.Build.0 = Release|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Release|x86.ActiveCfg = Release|Any CPU
+ {29EEDF03-0990-45F4-846E-2616970D1FA2}.Release|x86.Build.0 = Release|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Debug|x64.Build.0 = Debug|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Debug|x86.Build.0 = Debug|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Release|x64.ActiveCfg = Release|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Release|x64.Build.0 = Release|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Release|x86.ActiveCfg = Release|Any CPU
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {81E8CBCD-6319-49E7-9662-0475BD0791F4} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
- {B2F6369A-D737-4AFD-8B81-9B094DB07DA7} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
{3A5DDD20-5BD0-42F4-89F4-ACC0CE554028} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
{8ED116F4-9DDF-4C49-AB96-AE462E3D64C3} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
{6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
- {F8A0946A-5D25-4651-8079-B8D5776916FB} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
{3B38E8DA-8BFF-4264-AF16-47929E6398A3} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
+ {29EEDF03-0990-45F4-846E-2616970D1FA2} = {F594E7FD-1E72-4E51-A496-B019C2BA3180}
+ {2561F253-8F72-436A-BCC3-AA63AB82EDC0} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
EndGlobalSection
EndGlobal
diff --git a/docs/api/index.md b/docs/api/index.md
index a845c1d66..c53ce056c 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -20,9 +20,9 @@ the PowerShell debugger.
Use the @Microsoft.PowerShell.EditorServices.Console.ConsoleService to provide interactive
console support in the user's editor.
-Use the @Microsoft.PowerShell.EditorServices.Extensions.ExtensionService to allow
+Use the @Microsoft.PowerShell.EditorServices.Services.ExtensionService to allow
the user to extend the host editor with new capabilities using PowerShell code.
The core of all the services is the @Microsoft.PowerShell.EditorServices.PowerShellContext
class. This class manages a session's runspace and handles script and command
-execution no matter what state the runspace is in.
\ No newline at end of file
+execution no matter what state the runspace is in.
diff --git a/docs/guide/extensions.md b/docs/guide/extensions.md
index 6e964416c..b37c032a6 100644
--- a/docs/guide/extensions.md
+++ b/docs/guide/extensions.md
@@ -9,7 +9,7 @@ uses PowerShell Editor Services.
### Introducing `$psEditor`
The entry point for the PowerShell Editor Services extensibility model is the `$psEditor`
-object of the type @Microsoft.PowerShell.EditorServices.Extensions.EditorObject. For
+object of the type @Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorObject. For
those familiar with the PowerShell ISE's `$psISE` object, the `$psEditor` object is very
similar. The primary difference is that this model has been generalized to work against
any editor which leverages PowerShell Editor Services for its PowerShell editing experience.
@@ -19,7 +19,7 @@ any editor which leverages PowerShell Editor Services for its PowerShell editing
> please file an issue on our GitHub page.
This object gives access to all of the high-level services in the current
-editing session. For example, the @Microsoft.PowerShell.EditorServices.Extensions.EditorObject.Workspace
+editing session. For example, the @Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorObject.Workspace
property gives access to the editor's workspace, allowing you to create or open files
in the editor.
@@ -79,17 +79,17 @@ Register-EditorCommand `
-ScriptBlock { Write-Output "My command's script block was invoked!" }
```
-### The @Microsoft.PowerShell.EditorServices.Extensions.EditorContext parameter
+### The @Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext parameter
Your function, cmdlet, or ScriptBlock can optionally accept a single parameter
-of type @Microsoft.PowerShell.EditorServices.Extensions.EditorContext which provides
+of type @Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext which provides
information about the state of the host editor at the time your command was
invoked. With this object you can easily perform operations like manipulatin the
state of the user's active editor buffer or changing the current selection.
The usual convention is that a `$context` parameter is added to your editor
command's function. For now it is recommended that you fully specify the
-type of the @Microsoft.PowerShell.EditorServices.Extensions.EditorContext object
+type of the @Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext object
so that you get full IntelliSense on your context parameter.
Here is an example of using the `$context` parameter:
@@ -99,7 +99,7 @@ Register-EditorCommand `
-Name "MyModule.MyEditorCommandWithContext" `
-DisplayName "My command with context usage" `
-ScriptBlock {
- param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
+ param([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext]$context)
Write-Output "The user's cursor is on line $($context.CursorPosition.Line)!"
}
```
@@ -165,4 +165,4 @@ in that editor starts up.
> NOTE: In the future we plan to provide an easy way for the user to opt-in
> to the automatic loading of any editor command modules that they've installed
> from the PowerShell Gallery. If this interests you, please let us know on
-> [this GitHub issue](https://github.com/PowerShell/PowerShellEditorServices/issues/215).
\ No newline at end of file
+> [this GitHub issue](https://github.com/PowerShell/PowerShellEditorServices/issues/215).
diff --git a/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1 b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1
index ddb9aa389..09ff913ff 100644
--- a/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1
+++ b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1
@@ -9,7 +9,7 @@
@{
# Script module or binary module file associated with this manifest.
-RootModule = 'PowerShellEditorServices.VSCode.psm1'
+RootModule = "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.VSCode.dll"
# Version number of this module.
ModuleVersion = '0.2.0'
@@ -69,14 +69,14 @@ Description = 'Provides added functionality to PowerShell Editor Services for th
# NestedModules = @()
# 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.
-FunctionsToExport = @('New-VSCodeHtmlContentView',
- 'Show-VSCodeHtmlContentView',
- 'Close-VSCodeHtmlContentView',
- 'Set-VSCodeHtmlContentView',
- 'Write-VSCodeHtmlContentView')
+FunctionsToExport = @()
# 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.
-CmdletsToExport = @()
+CmdletsToExport = @('New-VSCodeHtmlContentView',
+ 'Show-VSCodeHtmlContentView',
+ 'Close-VSCodeHtmlContentView',
+ 'Set-VSCodeHtmlContentView',
+ 'Write-VSCodeHtmlContentView')
# Variables to export from this module
VariablesToExport = '*'
diff --git a/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1 b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1
deleted file mode 100644
index e7b34e076..000000000
--- a/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.VSCode.dll"
-
-if ($psEditor -is [Microsoft.PowerShell.EditorServices.Extensions.EditorObject]) {
- [Microsoft.PowerShell.EditorServices.VSCode.ComponentRegistration]::Register($psEditor.Components)
-}
-else {
- Write-Verbose '$psEditor object not found in the session, components will not be registered.'
-}
-
-Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -Recurse | ForEach-Object {
- . $PSItem.FullName
-}
diff --git a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Close-VSCodeHtmlContentView.ps1 b/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Close-VSCodeHtmlContentView.ps1
deleted file mode 100644
index f8cf0c9c6..000000000
--- a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Close-VSCodeHtmlContentView.ps1
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-function Close-VSCodeHtmlContentView {
- <#
- .SYNOPSIS
- Closes an HtmlContentView.
-
- .DESCRIPTION
- Closes an HtmlContentView inside of Visual Studio Code if
- it is displayed.
-
- .PARAMETER HtmlContentView
- The HtmlContentView to be closed.
-
- .EXAMPLE
- Close-VSCodeHtmlContentView -HtmlContentView $htmlContentView
- #>
- [CmdletBinding()]
- param (
- [Parameter(Mandatory = $true)]
- [Alias("View")]
- [ValidateNotNull()]
- [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentView]
- $HtmlContentView
- )
-
- process {
- $HtmlContentView.Close().Wait();
- }
-}
diff --git a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/New-VSCodeHtmlContentView.ps1 b/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/New-VSCodeHtmlContentView.ps1
deleted file mode 100644
index 0e9088bd3..000000000
--- a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/New-VSCodeHtmlContentView.ps1
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-function New-VSCodeHtmlContentView {
- <#
- .SYNOPSIS
- Creates a custom view in Visual Studio Code which displays HTML content.
-
- .DESCRIPTION
- Creates a custom view in Visual Studio Code which displays HTML content.
-
- .PARAMETER Title
- The title of the view.
-
- .PARAMETER ShowInColumn
- If specified, causes the new view to be displayed in the specified column.
- If unspecified, the Show-VSCodeHtmlContentView cmdlet will need to be used
- to display the view.
-
- .EXAMPLE
- # Create a new view called "My Custom View"
- $htmlContentView = New-VSCodeHtmlContentView -Title "My Custom View"
-
- .EXAMPLE
- # Create a new view and show it in the second view column
- $htmlContentView = New-VSCodeHtmlContentView -Title "My Custom View" -ShowInColumn Two
- #>
- [CmdletBinding()]
- [OutputType([Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentView])]
- param (
- [Parameter(Mandatory = $true)]
- [ValidateNotNullOrEmpty()]
- [string]
- $Title,
-
- [Parameter(Mandatory = $false)]
- [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.ViewColumn]
- $ShowInColumn
- )
-
- process {
- if ($psEditor -is [Microsoft.PowerShell.EditorServices.Extensions.EditorObject]) {
- $viewFeature = $psEditor.Components.Get([Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentViews])
- $view = $viewFeature.CreateHtmlContentViewAsync($Title).Result
-
- if ($ShowInColumn) {
- $view.Show($ShowInColumn).Wait();
- }
-
- return $view
- }
- }
-}
diff --git a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Set-VSCodeHtmlContentView.ps1 b/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Set-VSCodeHtmlContentView.ps1
deleted file mode 100644
index 98abf16a4..000000000
--- a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Set-VSCodeHtmlContentView.ps1
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-function Set-VSCodeHtmlContentView {
- <#
- .SYNOPSIS
- Sets the content of an HtmlContentView.
-
- .DESCRIPTION
- Sets the content of an HtmlContentView. If an empty string
- is passed, it causes the view's content to be cleared.
-
- .PARAMETER HtmlContentView
- The HtmlContentView where content will be set.
-
- .PARAMETER HtmlBodyContent
- The HTML content that will be placed inside the
tag
- of the view.
-
- .PARAMETER JavaScriptPaths
- An array of paths to JavaScript files that will be loaded
- into the view.
-
- .PARAMETER StyleSheetPaths
- An array of paths to stylesheet (CSS) files that will be
- loaded into the view.
-
- .EXAMPLE
- # Set the view content with an h1 header
- Set-VSCodeHtmlContentView -HtmlContentView $htmlContentView -HtmlBodyContent "Hello world! "
-
- .EXAMPLE
- # Clear the view
- Set-VSCodeHtmlContentView -View $htmlContentView -Content ""
- #>
- [CmdletBinding()]
- param (
- [Parameter(Mandatory = $true)]
- [Alias("View")]
- [ValidateNotNull()]
- [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentView]
- $HtmlContentView,
-
- [Parameter(Mandatory = $true)]
- [Alias("Content")]
- [AllowEmptyString()]
- [string]
- $HtmlBodyContent,
-
- [Parameter(Mandatory = $false)]
- [string[]]
- $JavaScriptPaths,
-
- [Parameter(Mandatory = $false)]
- [string[]]
- $StyleSheetPaths
- )
-
- process {
- $htmlContent = New-Object Microsoft.PowerShell.EditorServices.VSCode.CustomViews.HtmlContent
- $htmlContent.BodyContent = $HtmlBodyContent
- $htmlContent.JavaScriptPaths = $JavaScriptPaths
- $htmlContent.StyleSheetPaths = $StyleSheetPaths
-
- $HtmlContentView.SetContentAsync($htmlContent).Wait();
- }
-}
diff --git a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Show-VSCodeHtmlContentView.ps1 b/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Show-VSCodeHtmlContentView.ps1
deleted file mode 100644
index 1be803471..000000000
--- a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Show-VSCodeHtmlContentView.ps1
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-function Show-VSCodeHtmlContentView {
- <#
- .SYNOPSIS
- Shows an HtmlContentView.
-
- .DESCRIPTION
- Shows an HtmlContentView that has been created and not shown
- yet or has previously been closed.
-
- .PARAMETER HtmlContentView
- The HtmlContentView that will be shown.
-
- .PARAMETER ViewColumn
- If specified, causes the new view to be displayed in the specified column.
-
- .EXAMPLE
- # Shows the view in the first editor column
- Show-VSCodeHtmlContentView -HtmlContentView $htmlContentView
-
- .EXAMPLE
- # Shows the view in the third editor column
- Show-VSCodeHtmlContentView -View $htmlContentView -Column Three
- #>
- [CmdletBinding()]
- param (
- [Parameter(Mandatory = $true)]
- [Alias("View")]
- [ValidateNotNull()]
- [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentView]
- $HtmlContentView,
-
- [Parameter(Mandatory = $false)]
- [Alias("Column")]
- [ValidateNotNull()]
- [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.ViewColumn]
- $ViewColumn = [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.ViewColumn]::One
- )
-
- process {
- $HtmlContentView.Show($ViewColumn).Wait()
- }
-}
diff --git a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Write-VSCodeHtmlContentView.ps1 b/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Write-VSCodeHtmlContentView.ps1
deleted file mode 100644
index c21321ec9..000000000
--- a/module/PowerShellEditorServices.VSCode/Public/HtmlContentView/Write-VSCodeHtmlContentView.ps1
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-#
-
-function Write-VSCodeHtmlContentView {
- <#
- .SYNOPSIS
- Writes an HTML fragment to an HtmlContentView.
-
- .DESCRIPTION
- Writes an HTML fragment to an HtmlContentView. This new fragment
- is appended to the existing content, useful in cases where the
- output will be appended to an ongoing output stream.
-
- .PARAMETER HtmlContentView
- The HtmlContentView where content will be appended.
-
- .PARAMETER AppendedHtmlBodyContent
- The HTML content that will be appended to the view's element content.
-
- .EXAMPLE
- Write-VSCodeHtmlContentView -HtmlContentView $htmlContentView -AppendedHtmlBodyContent "Appended content "
-
- .EXAMPLE
- Write-VSCodeHtmlContentView -View $htmlContentView -Content "Appended content "
- #>
- [CmdletBinding()]
- param (
- [Parameter(Mandatory = $true)]
- [Alias("View")]
- [ValidateNotNull()]
- [Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentView]
- $HtmlContentView,
-
- [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
- [Alias("Content")]
- [ValidateNotNull()]
- [string]
- $AppendedHtmlBodyContent
- )
-
- process {
- $HtmlContentView.AppendContentAsync($AppendedHtmlBodyContent).Wait();
- }
-}
diff --git a/module/PowerShellEditorServices.VSCode/docs/Close-VSCodeHtmlContentView.md b/module/PowerShellEditorServices.VSCode/docs/Close-VSCodeHtmlContentView.md
new file mode 100644
index 000000000..559d4b9d1
--- /dev/null
+++ b/module/PowerShellEditorServices.VSCode/docs/Close-VSCodeHtmlContentView.md
@@ -0,0 +1,64 @@
+---
+external help file: Microsoft.PowerShell.EditorServices.VSCode.dll-Help.xml
+Module Name: PowerShellEditorServices.VSCode
+online version:
+schema: 2.0.0
+---
+
+# Close-VSCodeHtmlContentView
+
+## SYNOPSIS
+
+Closes an HtmlContentView.
+
+## SYNTAX
+
+```
+Close-VSCodeHtmlContentView [-HtmlContentView] []
+```
+
+## DESCRIPTION
+
+Closes an HtmlContentView inside of Visual Studio Code if it is displayed.
+
+## EXAMPLES
+
+### Example 1
+
+```powershell
+Close-VSCodeHtmlContentView -HtmlContentView $view
+```
+
+## PARAMETERS
+
+### -HtmlContentView
+
+The HtmlContentView to be closed.
+
+```yaml
+Type: IHtmlContentView
+Parameter Sets: (All)
+Aliases: View
+
+Required: True
+Position: 0
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+### None
+
+## OUTPUTS
+
+### System.Object
+
+## NOTES
+
+## RELATED LINKS
diff --git a/module/PowerShellEditorServices.VSCode/docs/New-VSCodeHtmlContentView.md b/module/PowerShellEditorServices.VSCode/docs/New-VSCodeHtmlContentView.md
new file mode 100644
index 000000000..ec837ddce
--- /dev/null
+++ b/module/PowerShellEditorServices.VSCode/docs/New-VSCodeHtmlContentView.md
@@ -0,0 +1,92 @@
+---
+external help file: Microsoft.PowerShell.EditorServices.VSCode.dll-Help.xml
+Module Name: PowerShellEditorServices.VSCode
+online version:
+schema: 2.0.0
+---
+
+# New-VSCodeHtmlContentView
+
+## SYNOPSIS
+
+Creates a custom view in Visual Studio Code which displays HTML content.
+
+## SYNTAX
+
+```
+New-VSCodeHtmlContentView [-Title] [[-ShowInColumn] ] []
+```
+
+## DESCRIPTION
+
+Creates a custom view in Visual Studio Code which displays HTML content.
+
+## EXAMPLES
+
+### Example 1
+
+```powershell
+$htmlContentView = New-VSCodeHtmlContentView -Title "My Custom View"
+```
+
+Create a new view called "My Custom View".
+
+### Example 2
+
+```powershell
+$htmlContentView = New-VSCodeHtmlContentView -Title "My Custom View" -ShowInColumn Two
+```
+
+Create a new view and show it in the second view column.
+
+## PARAMETERS
+
+### -ShowInColumn
+
+If specified, causes the new view to be displayed in the specified column.
+If unspecified, the Show-VSCodeHtmlContentView cmdlet will need to be used to display the view.
+
+```yaml
+Type: ViewColumn
+Parameter Sets: (All)
+Aliases:
+Accepted values: One, Two, Three
+
+Required: False
+Position: 1
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Title
+
+The title of the view.
+
+```yaml
+Type: String
+Parameter Sets: (All)
+Aliases:
+
+Required: True
+Position: 0
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+### None
+
+## OUTPUTS
+
+### Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentView
+
+## NOTES
+
+## RELATED LINKS
diff --git a/module/PowerShellEditorServices.VSCode/docs/Set-VSCodeHtmlContentView.md b/module/PowerShellEditorServices.VSCode/docs/Set-VSCodeHtmlContentView.md
new file mode 100644
index 000000000..830ff42ac
--- /dev/null
+++ b/module/PowerShellEditorServices.VSCode/docs/Set-VSCodeHtmlContentView.md
@@ -0,0 +1,123 @@
+---
+external help file: Microsoft.PowerShell.EditorServices.VSCode.dll-Help.xml
+Module Name: PowerShellEditorServices.VSCode
+online version:
+schema: 2.0.0
+---
+
+# Set-VSCodeHtmlContentView
+
+## SYNOPSIS
+
+Sets the content of an HtmlContentView.
+
+## SYNTAX
+
+```
+Set-VSCodeHtmlContentView [-HtmlContentView] [-HtmlBodyContent]
+ [[-JavaScriptPaths] ] [[-StyleSheetPaths] ] []
+```
+
+## DESCRIPTION
+
+Sets the content of an HtmlContentView. If an empty string is passed, it causes the view's content to be cleared.
+
+## EXAMPLES
+
+### Example 1
+
+```powershell
+Set-VSCodeHtmlContentView -HtmlContentView $htmlContentView -HtmlBodyContent "Hello world! "
+```
+
+Set the view content with an h1 header.
+
+### Example 2
+
+```powershell
+Set-VSCodeHtmlContentView -View $htmlContentView -Content ""
+```
+
+Clear the view.
+
+## PARAMETERS
+
+### -HtmlBodyContent
+
+The HTML content that will be placed inside the `` tag of the view.
+
+```yaml
+Type: String
+Parameter Sets: (All)
+Aliases: Content
+
+Required: True
+Position: 1
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -HtmlContentView
+
+The HtmlContentView where content will be set.
+
+```yaml
+Type: IHtmlContentView
+Parameter Sets: (All)
+Aliases: View
+
+Required: True
+Position: 0
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -JavaScriptPaths
+
+An array of paths to JavaScript files that will be loaded into the view.
+
+```yaml
+Type: String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: 2
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -StyleSheetPaths
+
+An array of paths to stylesheet (CSS) files that will be loaded into the view.
+
+```yaml
+Type: String[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: 3
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+### None
+
+## OUTPUTS
+
+### System.Object
+
+## NOTES
+
+## RELATED LINKS
diff --git a/module/PowerShellEditorServices.VSCode/docs/Show-VSCodeHtmlContentView.md b/module/PowerShellEditorServices.VSCode/docs/Show-VSCodeHtmlContentView.md
new file mode 100644
index 000000000..2659a3ead
--- /dev/null
+++ b/module/PowerShellEditorServices.VSCode/docs/Show-VSCodeHtmlContentView.md
@@ -0,0 +1,92 @@
+---
+external help file: Microsoft.PowerShell.EditorServices.VSCode.dll-Help.xml
+Module Name: PowerShellEditorServices.VSCode
+online version:
+schema: 2.0.0
+---
+
+# Show-VSCodeHtmlContentView
+
+## SYNOPSIS
+
+Shows an HtmlContentView.
+
+## SYNTAX
+
+```
+Show-VSCodeHtmlContentView [-HtmlContentView] [[-ViewColumn] ]
+ []
+```
+
+## DESCRIPTION
+
+Shows an HtmlContentView that has been created and not shown yet or has previously been closed.
+
+## EXAMPLES
+
+### Example 1
+
+```powershell
+Show-VSCodeHtmlContentView -HtmlContentView $htmlContentView
+```
+
+Shows the view in the first editor column.
+
+### Example 2
+
+```powershell
+Show-VSCodeHtmlContentView -View $htmlContentView -Column Three
+```
+
+Shows the view in the third editor column.
+
+## PARAMETERS
+
+### -HtmlContentView
+
+The HtmlContentView that will be shown.
+
+```yaml
+Type: IHtmlContentView
+Parameter Sets: (All)
+Aliases: View
+
+Required: True
+Position: 0
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -ViewColumn
+
+If specified, causes the new view to be displayed in the specified column.
+
+```yaml
+Type: ViewColumn
+Parameter Sets: (All)
+Aliases: Column
+Accepted values: One, Two, Three
+
+Required: False
+Position: 1
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+### None
+
+## OUTPUTS
+
+### System.Object
+
+## NOTES
+
+## RELATED LINKS
diff --git a/module/PowerShellEditorServices.VSCode/docs/Write-VSCodeHtmlContentView.md b/module/PowerShellEditorServices.VSCode/docs/Write-VSCodeHtmlContentView.md
new file mode 100644
index 000000000..79c930da4
--- /dev/null
+++ b/module/PowerShellEditorServices.VSCode/docs/Write-VSCodeHtmlContentView.md
@@ -0,0 +1,87 @@
+---
+external help file: Microsoft.PowerShell.EditorServices.VSCode.dll-Help.xml
+Module Name: PowerShellEditorServices.VSCode
+online version:
+schema: 2.0.0
+---
+
+# Write-VSCodeHtmlContentView
+
+## SYNOPSIS
+
+Writes an HTML fragment to an HtmlContentView.
+
+## SYNTAX
+
+```
+Write-VSCodeHtmlContentView [-HtmlContentView] [-AppendedHtmlBodyContent]
+ []
+```
+
+## DESCRIPTION
+
+Writes an HTML fragment to an HtmlContentView. This new fragment is appended to the existing content, useful in cases where the output will be appended to an ongoing output stream.
+
+## EXAMPLES
+
+### Example 1
+
+```powershell
+Write-VSCodeHtmlContentView -HtmlContentView $htmlContentView -AppendedHtmlBodyContent "Appended content "
+```
+
+### Example 2
+
+```powershell
+Write-VSCodeHtmlContentView -View $htmlContentView -Content "Appended content "
+```
+
+## PARAMETERS
+
+### -AppendedHtmlBodyContent
+
+The HTML content that will be appended to the view's `` element content.
+
+```yaml
+Type: String
+Parameter Sets: (All)
+Aliases: Content
+
+Required: True
+Position: 1
+Default value: None
+Accept pipeline input: True (ByValue)
+Accept wildcard characters: False
+```
+
+### -HtmlContentView
+
+The HtmlContentView where content will be appended.
+
+```yaml
+Type: IHtmlContentView
+Parameter Sets: (All)
+Aliases: View
+
+Required: True
+Position: 0
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### CommonParameters
+
+This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
+
+## INPUTS
+
+### System.String
+
+## OUTPUTS
+
+### System.Object
+
+## NOTES
+
+## RELATED LINKS
diff --git a/module/PowerShellEditorServices/Commands/Private/BuiltInCommands.ps1 b/module/PowerShellEditorServices/Commands/Private/BuiltInCommands.ps1
index 7c73e8358..e56e44af7 100644
--- a/module/PowerShellEditorServices/Commands/Private/BuiltInCommands.ps1
+++ b/module/PowerShellEditorServices/Commands/Private/BuiltInCommands.ps1
@@ -3,7 +3,7 @@ Register-EditorCommand `
-DisplayName 'Open Editor Profile' `
-SuppressOutput `
-ScriptBlock {
- param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
+ param([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext]$context)
If (!(Test-Path -Path $Profile)) { New-Item -Path $Profile -ItemType File }
$psEditor.Workspace.OpenFile($Profile)
}
@@ -13,18 +13,18 @@ Register-EditorCommand `
-DisplayName 'Open Profile from List (Current User)' `
-SuppressOutput `
-ScriptBlock {
- param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
-
- $Current = Split-Path -Path $profile -Leaf
+ param([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext]$context)
+
+ $Current = Split-Path -Path $profile -Leaf
$List = @($Current,'Microsoft.VSCode_profile.ps1','Microsoft.PowerShell_profile.ps1','Microsoft.PowerShellISE_profile.ps1','Profile.ps1') | Select-Object -Unique
$Choices = [System.Management.Automation.Host.ChoiceDescription[]] @($List)
$Selection = $host.ui.PromptForChoice('Please Select a Profile', '(Current User)', $choices,'0')
$Name = $List[$Selection]
-
+
$ProfileDir = Split-Path $Profile -Parent
$ProfileName = Join-Path -Path $ProfileDir -ChildPath $Name
-
+
If (!(Test-Path -Path $ProfileName)) { New-Item -Path $ProfileName -ItemType File }
-
+
$psEditor.Workspace.OpenFile($ProfileName)
- }
\ No newline at end of file
+ }
diff --git a/module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1 b/module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1
index 47623296a..9018680d9 100644
--- a/module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1
+++ b/module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1
@@ -47,7 +47,7 @@ function Register-EditorCommand {
$commandArgs += $Function
}
- $editorCommand = New-Object Microsoft.PowerShell.EditorServices.Extensions.EditorCommand -ArgumentList $commandArgs
+ $editorCommand = New-Object Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommand -ArgumentList $commandArgs
if ($psEditor.RegisterCommand($editorCommand))
{
Write-Verbose "Registered new command '$Name'"
diff --git a/module/PowerShellEditorServices/Commands/Public/Import-EditorCommand.ps1 b/module/PowerShellEditorServices/Commands/Public/Import-EditorCommand.ps1
index 9ddec5021..e57823a3f 100644
--- a/module/PowerShellEditorServices/Commands/Public/Import-EditorCommand.ps1
+++ b/module/PowerShellEditorServices/Commands/Public/Import-EditorCommand.ps1
@@ -7,7 +7,7 @@ function Import-EditorCommand {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
- [OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand])]
+ [OutputType([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommand])]
[CmdletBinding(DefaultParameterSetName='ByCommand')]
param(
[Parameter(Position=0,
@@ -75,7 +75,7 @@ function Import-EditorCommand {
$commands = $Command | Get-Command -ErrorAction SilentlyContinue
}
}
- $attributeType = [Microsoft.PowerShell.EditorServices.Extensions.EditorCommandAttribute]
+ $attributeType = [Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommandAttribute]
foreach ($aCommand in $commands) {
# Get the attribute from our command to get name info.
$details = $aCommand.ScriptBlock.Attributes | Where-Object TypeId -eq $attributeType
@@ -99,7 +99,7 @@ function Import-EditorCommand {
}
# Check for a context parameter.
$contextParameter = $aCommand.Parameters.Values |
- Where-Object ParameterType -eq ([Microsoft.PowerShell.EditorServices.Extensions.EditorContext])
+ Where-Object ParameterType -eq ([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorContext])
# If one is found then add a named argument. Otherwise call the command directly.
if ($contextParameter) {
@@ -109,7 +109,7 @@ function Import-EditorCommand {
$scriptBlock = [scriptblock]::Create($aCommand.Name)
}
- $editorCommand = New-Object Microsoft.PowerShell.EditorServices.Extensions.EditorCommand @(
+ $editorCommand = New-Object Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommand @(
<# commandName: #> $details.Name,
<# displayName: #> $details.DisplayName,
<# suppressOutput: #> $details.SuppressOutput,
diff --git a/module/PowerShellEditorServices/PowerShellEditorServices.psm1 b/module/PowerShellEditorServices/PowerShellEditorServices.psm1
index 47efd591f..b37b6ee65 100644
--- a/module/PowerShellEditorServices/PowerShellEditorServices.psm1
+++ b/module/PowerShellEditorServices/PowerShellEditorServices.psm1
@@ -8,15 +8,9 @@ if ($PSEdition -eq 'Desktop') {
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Desktop/System.IO.Pipes.AccessControl.dll"
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Desktop/System.Security.AccessControl.dll"
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Desktop/System.Security.Principal.Windows.dll"
-} elseif ($PSVersionTable.PSVersion -ge '6.0' -and $PSVersionTable.PSVersion -lt '6.1' -and $IsWindows) {
- Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/6.0/System.IO.Pipes.AccessControl.dll"
- Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/6.0/System.Security.AccessControl.dll"
- Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/6.0/System.Security.Principal.Windows.dll"
}
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.dll"
-Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.Host.dll"
-Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.Protocol.dll"
function Start-EditorServicesHost {
[CmdletBinding()]
@@ -97,13 +91,13 @@ function Start-EditorServicesHost {
$editorServicesHost = $null
$hostDetails =
- Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Session.HostDetails @(
+ Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Hosting.HostDetails @(
$HostName,
$HostProfileId,
(Microsoft.PowerShell.Utility\New-Object System.Version @($HostVersion)))
$editorServicesHost =
- Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Host.EditorServicesHost @(
+ Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Hosting.EditorServicesHost @(
$hostDetails,
$BundledModulesPath,
$EnableConsoleRepl.IsPresent,
@@ -114,7 +108,7 @@ function Start-EditorServicesHost {
# Build the profile paths using the root paths of the current $profile variable
$profilePaths =
- Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Session.ProfilePaths @(
+ Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Hosting.ProfilePaths @(
$hostDetails.ProfileId,
[System.IO.Path]::GetDirectoryName($profile.AllUsersAllHosts),
[System.IO.Path]::GetDirectoryName($profile.CurrentUserAllHosts))
@@ -122,32 +116,32 @@ function Start-EditorServicesHost {
$editorServicesHost.StartLogging($LogPath, $LogLevel);
$languageServiceConfig =
- Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportConfig
+ Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportConfig
$debugServiceConfig =
- Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportConfig
+ Microsoft.PowerShell.Utility\New-Object Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportConfig
switch ($PSCmdlet.ParameterSetName) {
"Stdio" {
- $languageServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportType]::Stdio
- $debugServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportType]::Stdio
+ $languageServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportType]::Stdio
+ $debugServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportType]::Stdio
break
}
"NamedPipe" {
- $languageServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportType]::NamedPipe
+ $languageServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportType]::NamedPipe
$languageServiceConfig.InOutPipeName = "$LanguageServiceNamedPipe"
if ($DebugServiceNamedPipe) {
- $debugServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportType]::NamedPipe
+ $debugServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportType]::NamedPipe
$debugServiceConfig.InOutPipeName = "$DebugServiceNamedPipe"
}
break
}
"NamedPipeSimplex" {
- $languageServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportType]::NamedPipe
+ $languageServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportType]::NamedPipe
$languageServiceConfig.InPipeName = $LanguageServiceInNamedPipe
$languageServiceConfig.OutPipeName = $LanguageServiceOutNamedPipe
if ($DebugServiceInNamedPipe -and $DebugServiceOutNamedPipe) {
- $debugServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Host.EditorServiceTransportType]::NamedPipe
+ $debugServiceConfig.TransportType = [Microsoft.PowerShell.EditorServices.Hosting.EditorServiceTransportType]::NamedPipe
$debugServiceConfig.InPipeName = $DebugServiceInNamedPipe
$debugServiceConfig.OutPipeName = $DebugServiceOutNamedPipe
}
diff --git a/module/docs/Import-EditorCommand.md b/module/docs/Import-EditorCommand.md
index d84c66d53..cf90e8c55 100644
--- a/module/docs/Import-EditorCommand.md
+++ b/module/docs/Import-EditorCommand.md
@@ -30,7 +30,7 @@ The Import-EditorCommand function will search the specified module for functions
Alternatively, you can specify command info objects (like those from the Get-Command cmdlet) to be processed directly.
-To tag a command as an editor command, attach the attribute 'Microsoft.PowerShell.EditorServices.Extensions.EditorCommandAttribute' to the function like you would with 'CmdletBindingAttribute'. The attribute accepts the named parameters 'Name', 'DisplayName', and 'SuppressOutput'.
+To tag a command as an editor command, attach the attribute 'Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommandAttribute' to the function like you would with 'CmdletBindingAttribute'. The attribute accepts the named parameters 'Name', 'DisplayName', and 'SuppressOutput'.
## EXAMPLES
@@ -55,7 +55,7 @@ Registers all editor commands that contain "Editor" in the name and return all s
```powershell
function Invoke-MyEditorCommand {
[CmdletBinding()]
- [Microsoft.PowerShell.EditorServices.Extensions.EditorCommand(DisplayName='My Command', SuppressOutput)]
+ [Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommand(DisplayName='My Command', SuppressOutput)]
param()
end {
ConvertTo-ScriptExtent -Offset 0 | Set-ScriptExtent -Text 'My Command!'
@@ -145,7 +145,7 @@ You can pass commands to register as editor commands.
## OUTPUTS
-### Microsoft.PowerShell.EditorServices.Extensions.EditorCommand
+### Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommand
If the "PassThru" parameter is specified editor commands that were successfully registered
will be returned. This function does not output to the pipeline otherwise.
diff --git a/scripts/azurePipelinesBuild.ps1 b/scripts/azurePipelinesBuild.ps1
index ab31ed358..774f57815 100644
--- a/scripts/azurePipelinesBuild.ps1
+++ b/scripts/azurePipelinesBuild.ps1
@@ -10,6 +10,9 @@ if ($IsWindows -or $PSVersionTable.PSVersion.Major -lt 6) {
Import-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force
}
+# Update help needed for SignatureHelp LSP request.
+Update-Help -Force -ErrorAction SilentlyContinue
+
# Needed for build and docs gen.
Install-Module InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser
Install-Module PlatyPS -RequiredVersion 0.9.0 -Scope CurrentUser
diff --git a/src/PowerShellEditorServices.Host/App.config b/src/PowerShellEditorServices.Host/App.config
deleted file mode 100644
index 066f94c5f..000000000
--- a/src/PowerShellEditorServices.Host/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/src/PowerShellEditorServices.Host/CodeLens/CodeLensExtensions.cs b/src/PowerShellEditorServices.Host/CodeLens/CodeLensExtensions.cs
deleted file mode 100644
index c3be72bfe..000000000
--- a/src/PowerShellEditorServices.Host/CodeLens/CodeLensExtensions.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Management.Automation.Language;
-using Microsoft.PowerShell.EditorServices.CodeLenses;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using LanguageServer = Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-
-namespace Microsoft.PowerShell.EditorServices
-{
- public static class ICodeLensExtensions
- {
- public static LanguageServer.CodeLens ToProtocolCodeLens(
- this CodeLens codeLens,
- JsonSerializer jsonSerializer)
- {
- return new LanguageServer.CodeLens
- {
- Range = codeLens.ScriptExtent.ToRange(),
- Command = codeLens.Command.ToProtocolCommand(jsonSerializer)
- };
- }
-
- public static LanguageServer.CodeLens ToProtocolCodeLens(
- this CodeLens codeLens,
- object codeLensData,
- JsonSerializer jsonSerializer)
- {
- LanguageServer.ServerCommand command = null;
-
- if (codeLens.Command != null)
- {
- command = codeLens.Command.ToProtocolCommand(jsonSerializer);
- }
-
- return new LanguageServer.CodeLens
- {
- Range = codeLens.ScriptExtent.ToRange(),
- Data = JToken.FromObject(codeLensData, jsonSerializer),
- Command = command
- };
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs b/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs
deleted file mode 100644
index d90d77333..000000000
--- a/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Components;
-using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Utility;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-
-using LanguageServer = Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-
-namespace Microsoft.PowerShell.EditorServices.CodeLenses
-{
- ///
- /// Implements the CodeLens feature for EditorServices.
- ///
- internal class CodeLensFeature :
- FeatureComponentBase,
- ICodeLenses
- {
-
- ///
- /// Create a new CodeLens instance around a given editor session
- /// from the component registry.
- ///
- ///
- /// The component registry to provider other components and to register the CodeLens provider in.
- ///
- /// The editor session context of the CodeLens provider.
- /// A new CodeLens provider for the given editor session.
- public static CodeLensFeature Create(
- IComponentRegistry components,
- EditorSession editorSession)
- {
- var codeLenses =
- new CodeLensFeature(
- editorSession,
- JsonSerializer.Create(Constants.JsonSerializerSettings),
- components.Get());
-
- var messageHandlers = components.Get();
-
- messageHandlers.SetRequestHandler(
- CodeLensRequest.Type,
- codeLenses.HandleCodeLensRequestAsync);
-
- messageHandlers.SetRequestHandler(
- CodeLensResolveRequest.Type,
- codeLenses.HandleCodeLensResolveRequestAsync);
-
- codeLenses.Providers.Add(
- new ReferencesCodeLensProvider(
- editorSession));
-
- codeLenses.Providers.Add(
- new PesterCodeLensProvider(
- editorSession));
-
- editorSession.Components.Register(codeLenses);
-
- return codeLenses;
- }
-
- ///
- /// The editor session context to get workspace and language server data from.
- ///
- private readonly EditorSession _editorSession;
-
- ///
- /// The json serializer instance for CodeLens object translation.
- ///
- private readonly JsonSerializer _jsonSerializer;
-
- ///
- ///
- ///
- ///
- ///
- ///
- private CodeLensFeature(
- EditorSession editorSession,
- JsonSerializer jsonSerializer,
- ILogger logger)
- : base(logger)
- {
- _editorSession = editorSession;
- _jsonSerializer = jsonSerializer;
- }
-
- ///
- /// Get all the CodeLenses for a given script file.
- ///
- /// The PowerShell script file to get CodeLenses for.
- /// All generated CodeLenses for the given script file.
- public CodeLens[] ProvideCodeLenses(ScriptFile scriptFile)
- {
- return InvokeProviders(provider => provider.ProvideCodeLenses(scriptFile))
- .SelectMany(codeLens => codeLens)
- .ToArray();
- }
-
- ///
- /// Handles a request for CodeLenses from VSCode.
- ///
- /// Parameters on the CodeLens request that was received.
- ///
- private async Task HandleCodeLensRequestAsync(
- CodeLensRequest codeLensParams,
- RequestContext requestContext)
- {
- ScriptFile scriptFile = _editorSession.Workspace.GetFile(
- codeLensParams.TextDocument.Uri);
-
- CodeLens[] codeLensResults = ProvideCodeLenses(scriptFile);
-
- var codeLensResponse = new LanguageServer.CodeLens[codeLensResults.Length];
- for (int i = 0; i < codeLensResults.Length; i++)
- {
- codeLensResponse[i] = codeLensResults[i].ToProtocolCodeLens(
- new CodeLensData
- {
- Uri = codeLensResults[i].File.DocumentUri,
- ProviderId = codeLensResults[i].Provider.ProviderId
- },
- _jsonSerializer);
- }
-
- await requestContext.SendResultAsync(codeLensResponse);
- }
-
- ///
- /// Handle a CodeLens resolve request from VSCode.
- ///
- /// The CodeLens to be resolved/updated.
- ///
- private async Task HandleCodeLensResolveRequestAsync(
- LanguageServer.CodeLens codeLens,
- RequestContext requestContext)
- {
- if (codeLens.Data != null)
- {
- // TODO: Catch deserializtion exception on bad object
- CodeLensData codeLensData = codeLens.Data.ToObject();
-
- ICodeLensProvider originalProvider =
- Providers.FirstOrDefault(
- provider => provider.ProviderId.Equals(codeLensData.ProviderId));
-
- if (originalProvider != null)
- {
- ScriptFile scriptFile =
- _editorSession.Workspace.GetFile(
- codeLensData.Uri);
-
- ScriptRegion region = new ScriptRegion
- {
- StartLineNumber = codeLens.Range.Start.Line + 1,
- StartColumnNumber = codeLens.Range.Start.Character + 1,
- EndLineNumber = codeLens.Range.End.Line + 1,
- EndColumnNumber = codeLens.Range.End.Character + 1
- };
-
- CodeLens originalCodeLens =
- new CodeLens(
- originalProvider,
- scriptFile,
- region);
-
- var resolvedCodeLens =
- await originalProvider.ResolveCodeLensAsync(
- originalCodeLens,
- CancellationToken.None);
-
- await requestContext.SendResultAsync(
- resolvedCodeLens.ToProtocolCodeLens(
- _jsonSerializer));
- }
- else
- {
- await requestContext.SendErrorAsync(
- $"Could not find provider for the original CodeLens: {codeLensData.ProviderId}");
- }
- }
- }
-
- ///
- /// Represents data expected back in an LSP CodeLens response.
- ///
- private class CodeLensData
- {
- public string Uri { get; set; }
-
- public string ProviderId {get; set; }
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Host/Commands/ClientCommandExtensions.cs b/src/PowerShellEditorServices.Host/Commands/ClientCommandExtensions.cs
deleted file mode 100644
index 95594d9b6..000000000
--- a/src/PowerShellEditorServices.Host/Commands/ClientCommandExtensions.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Commands;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-using LanguageServer = Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-
-namespace Microsoft.PowerShell.EditorServices
-{
- public static class ClientCommandExtensions
- {
- public static LanguageServer.ServerCommand ToProtocolCommand(
- this ClientCommand clientCommand,
- JsonSerializer jsonSerializer)
- {
- return new LanguageServer.ServerCommand
- {
- Command = clientCommand.Name,
- Title = clientCommand.Title,
- Arguments =
- JArray.FromObject(
- clientCommand.Arguments,
- jsonSerializer)
- };
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Host/EditorServicesHost.cs b/src/PowerShellEditorServices.Host/EditorServicesHost.cs
deleted file mode 100644
index 4a4acf9c6..000000000
--- a/src/PowerShellEditorServices.Host/EditorServicesHost.cs
+++ /dev/null
@@ -1,557 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Components;
-using Microsoft.PowerShell.EditorServices.CodeLenses;
-using Microsoft.PowerShell.EditorServices.Extensions;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
-using Microsoft.PowerShell.EditorServices.Protocol.Server;
-using Microsoft.PowerShell.EditorServices.Session;
-using Microsoft.PowerShell.EditorServices.Symbols;
-using Microsoft.PowerShell.EditorServices.Utility;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Management.Automation;
-using System.Management.Automation.Runspaces;
-using System.Management.Automation.Host;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Host
-{
- public enum EditorServicesHostStatus
- {
- Started,
- Failed,
- Ended
- }
-
- public enum EditorServiceTransportType
- {
- NamedPipe,
- Stdio
- }
-
- public class EditorServiceTransportConfig
- {
- public EditorServiceTransportType TransportType { get; set; }
- ///
- /// Configures the endpoint of the transport.
- /// For Stdio it's ignored.
- /// For NamedPipe it's the pipe name.
- ///
- public string InOutPipeName { get; set; }
-
- public string OutPipeName { get; set; }
-
- public string InPipeName { get; set; }
-
- internal string Endpoint => OutPipeName != null && InPipeName != null ? $"In pipe: {InPipeName} Out pipe: {OutPipeName}" : $" InOut pipe: {InOutPipeName}";
- }
-
- ///
- /// Provides a simplified interface for hosting the language and debug services
- /// over the named pipe server protocol.
- ///
- public class EditorServicesHost
- {
- #region Private Fields
-
- private readonly PSHost internalHost;
- private string[] additionalModules;
- private string bundledModulesPath;
- private DebugAdapter debugAdapter;
- private EditorSession editorSession;
- private bool enableConsoleRepl;
- private HashSet featureFlags;
- private HostDetails hostDetails;
- private LanguageServer languageServer;
- private ILogger logger;
- private ProfilePaths profilePaths;
- private TaskCompletionSource serverCompletedTask;
-
- private IServerListener languageServiceListener;
- private IServerListener debugServiceListener;
-
- #endregion
-
- #region Properties
-
- public EditorServicesHostStatus Status { get; private set; }
-
- #endregion
-
- #region Constructors
-
- ///
- /// Initializes a new instance of the EditorServicesHost class and waits for
- /// the debugger to attach if waitForDebugger is true.
- ///
- /// The details of the host which is launching PowerShell Editor Services.
- /// Provides a path to PowerShell modules bundled with the host, if any. Null otherwise.
- /// If true, causes the host to wait for the debugger to attach before proceeding.
- /// Modules to be loaded when initializing the new runspace.
- /// Features to enable for this instance.
- public EditorServicesHost(
- HostDetails hostDetails,
- string bundledModulesPath,
- bool enableConsoleRepl,
- bool waitForDebugger,
- string[] additionalModules,
- string[] featureFlags)
- : this(
- hostDetails,
- bundledModulesPath,
- enableConsoleRepl,
- waitForDebugger,
- additionalModules,
- featureFlags,
- GetInternalHostFromDefaultRunspace())
- {
- }
-
- ///
- /// Initializes a new instance of the EditorServicesHost class and waits for
- /// the debugger to attach if waitForDebugger is true.
- ///
- /// The details of the host which is launching PowerShell Editor Services.
- /// Provides a path to PowerShell modules bundled with the host, if any. Null otherwise.
- /// If true, causes the host to wait for the debugger to attach before proceeding.
- /// Modules to be loaded when initializing the new runspace.
- /// Features to enable for this instance.
- /// The value of the $Host variable in the original runspace.
- public EditorServicesHost(
- HostDetails hostDetails,
- string bundledModulesPath,
- bool enableConsoleRepl,
- bool waitForDebugger,
- string[] additionalModules,
- string[] featureFlags,
- PSHost internalHost)
- {
- Validate.IsNotNull(nameof(hostDetails), hostDetails);
- Validate.IsNotNull(nameof(internalHost), internalHost);
-
- this.hostDetails = hostDetails;
- this.enableConsoleRepl = enableConsoleRepl;
- this.bundledModulesPath = bundledModulesPath;
- this.additionalModules = additionalModules ?? new string[0];
- this.featureFlags = new HashSet(featureFlags ?? new string[0]);
- this.serverCompletedTask = new TaskCompletionSource();
- this.internalHost = internalHost;
-
-#if DEBUG
- if (waitForDebugger)
- {
- if (System.Diagnostics.Debugger.IsAttached)
- {
- System.Diagnostics.Debugger.Break();
- }
- else
- {
- System.Diagnostics.Debugger.Launch();
- }
- }
-#endif
-
- // Catch unhandled exceptions for logging purposes
- AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
- }
-
- #endregion
-
- #region Public Methods
-
- ///
- /// Starts the Logger for the specified file path and log level.
- ///
- /// The path of the log file to be written.
- /// The minimum level of log messages to be written.
- public void StartLogging(string logFilePath, LogLevel logLevel)
- {
- this.logger = Logging.CreateLogger()
- .LogLevel(logLevel)
- .AddLogFile(logFilePath)
- .Build();
-
- FileVersionInfo fileVersionInfo =
- FileVersionInfo.GetVersionInfo(this.GetType().GetTypeInfo().Assembly.Location);
-
- string osVersion = RuntimeInformation.OSDescription;
-
- string osArch = GetOSArchitecture();
-
- string buildTime = BuildInfo.BuildTime?.ToString("s", System.Globalization.CultureInfo.InvariantCulture) ?? "";
-
- string logHeader = $@"
-PowerShell Editor Services Host v{fileVersionInfo.FileVersion} starting (PID {Process.GetCurrentProcess().Id}
-
- Host application details:
-
- Name: {this.hostDetails.Name}
- Version: {this.hostDetails.Version}
- ProfileId: {this.hostDetails.ProfileId}
- Arch: {osArch}
-
- Operating system details:
-
- Version: {osVersion}
- Arch: {osArch}
-
- Build information:
-
- Version: {BuildInfo.BuildVersion}
- Origin: {BuildInfo.BuildOrigin}
- Date: {buildTime}
-";
-
- this.logger.Write(LogLevel.Normal, logHeader);
- }
-
- ///
- /// Starts the language service with the specified config.
- ///
- /// The config that contains information on the communication protocol that will be used.
- /// The profiles that will be loaded in the session.
- public void StartLanguageService(
- EditorServiceTransportConfig config,
- ProfilePaths profilePaths)
- {
- this.profilePaths = profilePaths;
-
- this.languageServiceListener = CreateServiceListener(MessageProtocolType.LanguageServer, config);
-
- this.languageServiceListener.ClientConnect += this.OnLanguageServiceClientConnectAsync;
- this.languageServiceListener.Start();
-
- this.logger.Write(
- LogLevel.Normal,
- string.Format(
- "Language service started, type = {0}, endpoint = {1}",
- config.TransportType, config.Endpoint));
- }
-
- private async void OnLanguageServiceClientConnectAsync(
- object sender,
- ChannelBase serverChannel)
- {
- MessageDispatcher messageDispatcher = new MessageDispatcher(this.logger);
-
- ProtocolEndpoint protocolEndpoint =
- new ProtocolEndpoint(
- serverChannel,
- messageDispatcher,
- this.logger);
-
- protocolEndpoint.UnhandledException += ProtocolEndpoint_UnhandledException;
-
- this.editorSession =
- CreateSession(
- this.hostDetails,
- this.profilePaths,
- protocolEndpoint,
- messageDispatcher,
- this.enableConsoleRepl);
-
- this.languageServer =
- new LanguageServer(
- this.editorSession,
- messageDispatcher,
- protocolEndpoint,
- this.serverCompletedTask,
- this.logger);
-
- await this.editorSession.PowerShellContext.ImportCommandsModuleAsync(
- Path.Combine(
- Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location),
- @"..\Commands"));
-
- this.languageServer.Start();
-
- // TODO: This can be moved to the point after the $psEditor object
- // gets initialized when that is done earlier than LanguageServer.Initialize
- foreach (string module in this.additionalModules)
- {
- var command =
- new System.Management.Automation.PSCommand()
- .AddCommand("Microsoft.PowerShell.Core\\Import-Module")
- .AddParameter("Name", module);
-
- await this.editorSession.PowerShellContext.ExecuteCommandAsync(
- command,
- sendOutputToHost: false,
- sendErrorToHost: true);
- }
-
- protocolEndpoint.Start();
- }
-
- ///
- /// Starts the debug service with the specified config.
- ///
- /// The config that contains information on the communication protocol that will be used.
- /// The profiles that will be loaded in the session.
- /// Determines if we will reuse the session that we have.
- public void StartDebugService(
- EditorServiceTransportConfig config,
- ProfilePaths profilePaths,
- bool useExistingSession)
- {
- this.debugServiceListener = CreateServiceListener(MessageProtocolType.DebugAdapter, config);
- this.debugServiceListener.ClientConnect += OnDebugServiceClientConnect;
- this.debugServiceListener.Start();
-
- this.logger.Write(
- LogLevel.Normal,
- string.Format(
- "Debug service started, type = {0}, endpoint = {1}",
- config.TransportType, config.Endpoint));
- }
-
- private void OnDebugServiceClientConnect(object sender, ChannelBase serverChannel)
- {
- MessageDispatcher messageDispatcher = new MessageDispatcher(this.logger);
-
- ProtocolEndpoint protocolEndpoint =
- new ProtocolEndpoint(
- serverChannel,
- messageDispatcher,
- this.logger);
-
- protocolEndpoint.UnhandledException += ProtocolEndpoint_UnhandledException;
-
- bool ownsEditorSession = this.editorSession == null;
-
- if (ownsEditorSession)
- {
- this.editorSession =
- this.CreateDebugSession(
- this.hostDetails,
- profilePaths,
- protocolEndpoint,
- messageDispatcher,
- this.languageServer?.EditorOperations,
- this.enableConsoleRepl);
- }
-
- this.debugAdapter =
- new DebugAdapter(
- this.editorSession,
- ownsEditorSession,
- messageDispatcher,
- protocolEndpoint,
- this.logger);
-
- this.debugAdapter.SessionEnded +=
- (obj, args) =>
- {
- if (!ownsEditorSession)
- {
- this.logger.Write(
- LogLevel.Normal,
- "Previous debug session ended, restarting debug service listener...");
- this.debugServiceListener.Stop();
- this.debugServiceListener.Start();
- }
- else if (this.debugAdapter.IsUsingTempIntegratedConsole)
- {
- this.logger.Write(
- LogLevel.Normal,
- "Previous temp debug session ended");
- }
- else
- {
- // Exit the host process
- this.serverCompletedTask.SetResult(true);
- }
- };
-
- this.debugAdapter.Start();
- protocolEndpoint.Start();
- }
-
- ///
- /// Stops the language or debug services if either were started.
- ///
- public void StopServices()
- {
- // TODO: Need a new way to shut down the services
-
- this.languageServer = null;
-
- this.debugAdapter = null;
- }
-
- ///
- /// Waits for either the language or debug service to shut down.
- ///
- public void WaitForCompletion()
- {
- // TODO: We need a way to know when to complete this task!
- this.serverCompletedTask.Task.Wait();
- }
-
- #endregion
-
- #region Private Methods
-
- private static PSHost GetInternalHostFromDefaultRunspace()
- {
- using (var pwsh = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace))
- {
- return pwsh.AddScript("$Host").Invoke().First();
- }
- }
-
- private EditorSession CreateSession(
- HostDetails hostDetails,
- ProfilePaths profilePaths,
- IMessageSender messageSender,
- IMessageHandlers messageHandlers,
- bool enableConsoleRepl)
- {
- EditorSession editorSession = new EditorSession(this.logger);
- PowerShellContext powerShellContext = new PowerShellContext(this.logger, this.featureFlags.Contains("PSReadLine"));
-
- EditorServicesPSHostUserInterface hostUserInterface =
- enableConsoleRepl
- ? (EditorServicesPSHostUserInterface) new TerminalPSHostUserInterface(powerShellContext, this.logger, this.internalHost)
- : new ProtocolPSHostUserInterface(powerShellContext, messageSender, this.logger);
-
- EditorServicesPSHost psHost =
- new EditorServicesPSHost(
- powerShellContext,
- hostDetails,
- hostUserInterface,
- this.logger);
-
- Runspace initialRunspace = PowerShellContext.CreateRunspace(psHost);
- powerShellContext.Initialize(profilePaths, initialRunspace, true, hostUserInterface);
-
- editorSession.StartSession(powerShellContext, hostUserInterface);
-
- // TODO: Move component registrations elsewhere!
- editorSession.Components.Register(this.logger);
- editorSession.Components.Register(messageHandlers);
- editorSession.Components.Register(messageSender);
- editorSession.Components.Register(powerShellContext);
-
- CodeLensFeature.Create(editorSession.Components, editorSession);
- DocumentSymbolFeature.Create(editorSession.Components, editorSession);
-
- return editorSession;
- }
-
- private EditorSession CreateDebugSession(
- HostDetails hostDetails,
- ProfilePaths profilePaths,
- IMessageSender messageSender,
- IMessageHandlers messageHandlers,
- IEditorOperations editorOperations,
- bool enableConsoleRepl)
- {
- EditorSession editorSession = new EditorSession(this.logger);
- PowerShellContext powerShellContext = new PowerShellContext(
- this.logger,
- this.featureFlags.Contains("PSReadLine"));
-
- EditorServicesPSHostUserInterface hostUserInterface =
- enableConsoleRepl
- ? (EditorServicesPSHostUserInterface) new TerminalPSHostUserInterface(powerShellContext, this.logger, this.internalHost)
- : new ProtocolPSHostUserInterface(powerShellContext, messageSender, this.logger);
-
- EditorServicesPSHost psHost =
- new EditorServicesPSHost(
- powerShellContext,
- hostDetails,
- hostUserInterface,
- this.logger);
-
- Runspace initialRunspace = PowerShellContext.CreateRunspace(psHost);
- powerShellContext.Initialize(profilePaths, initialRunspace, true, hostUserInterface);
-
- editorSession.StartDebugSession(
- powerShellContext,
- hostUserInterface,
- editorOperations);
-
- return editorSession;
- }
-
- private void ProtocolEndpoint_UnhandledException(object sender, Exception e)
- {
- this.logger.Write(
- LogLevel.Error,
- "PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.");
-
- this.serverCompletedTask.SetException(e);
- }
-
- private void CurrentDomain_UnhandledException(
- object sender,
- UnhandledExceptionEventArgs e)
- {
- // Log the exception
- this.logger.Write(LogLevel.Error, $"FATAL UNHANDLED EXCEPTION: {e.ExceptionObject}");
- }
-
- private IServerListener CreateServiceListener(MessageProtocolType protocol, EditorServiceTransportConfig config)
- {
- switch (config.TransportType)
- {
- case EditorServiceTransportType.Stdio:
- {
- return new StdioServerListener(protocol, this.logger);
- }
-
- case EditorServiceTransportType.NamedPipe:
- {
- if ((config.OutPipeName != null) && (config.InPipeName != null))
- {
- this.logger.Write(LogLevel.Verbose, $"Creating NamedPipeServerListener for ${protocol} protocol with two pipes: In: '{config.InPipeName}'. Out: '{config.OutPipeName}'");
- return new NamedPipeServerListener(protocol, config.InPipeName, config.OutPipeName, this.logger);
- }
- else
- {
- return new NamedPipeServerListener(protocol, config.InOutPipeName, this.logger);
- }
- }
-
- default:
- {
- throw new NotSupportedException();
- }
- }
- }
-
- ///
- /// Gets the OSArchitecture for logging. Cannot use System.Runtime.InteropServices.RuntimeInformation.OSArchitecture
- /// directly, since this tries to load API set DLLs in win7 and crashes.
- ///
- ///
- private string GetOSArchitecture()
- {
- // If on win7 (version 6.1.x), avoid System.Runtime.InteropServices.RuntimeInformation
- if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version < new Version(6, 2))
- {
- if (Environment.Is64BitProcess)
- {
- return "X64";
- }
-
- return "X86";
- }
-
- return RuntimeInformation.OSArchitecture.ToString();
- }
-
- #endregion
- }
-}
diff --git a/src/PowerShellEditorServices.Host/PowerShellEditorServices.Host.csproj b/src/PowerShellEditorServices.Host/PowerShellEditorServices.Host.csproj
deleted file mode 100644
index 020372b3f..000000000
--- a/src/PowerShellEditorServices.Host/PowerShellEditorServices.Host.csproj
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- PowerShell Editor Services Host Process
- Provides a process for hosting the PowerShell Editor Services library exposed by a JSON message protocol.
- netstandard2.0
- Microsoft.PowerShell.EditorServices.Host
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs b/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs
deleted file mode 100644
index da3402bde..000000000
--- a/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Components;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-using Microsoft.PowerShell.EditorServices.Utility;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-
-using Servers = Microsoft.PowerShell.EditorServices.Protocol.Server;
-
-namespace Microsoft.PowerShell.EditorServices.Symbols
-{
- internal class DocumentSymbolFeature :
- FeatureComponentBase,
- IDocumentSymbols
- {
- private EditorSession editorSession;
-
- public DocumentSymbolFeature(
- EditorSession editorSession,
- IMessageHandlers messageHandlers,
- ILogger logger)
- : base(logger)
- {
- this.editorSession = editorSession;
-
- messageHandlers.SetRequestHandler(
- DocumentSymbolRequest.Type,
- this.HandleDocumentSymbolRequestAsync);
- }
-
- public static DocumentSymbolFeature Create(
- IComponentRegistry components,
- EditorSession editorSession)
- {
- var documentSymbols =
- new DocumentSymbolFeature(
- editorSession,
- components.Get(),
- components.Get());
-
- documentSymbols.Providers.Add(
- new ScriptDocumentSymbolProvider(
- editorSession.PowerShellContext.LocalPowerShellVersion.Version));
-
- documentSymbols.Providers.Add(
- new PsdDocumentSymbolProvider());
-
- documentSymbols.Providers.Add(
- new PesterDocumentSymbolProvider());
-
- editorSession.Components.Register(documentSymbols);
-
- return documentSymbols;
- }
-
- public IEnumerable ProvideDocumentSymbols(
- ScriptFile scriptFile)
- {
- return
- this.InvokeProviders(p => p.ProvideDocumentSymbols(scriptFile))
- .SelectMany(r => r);
- }
-
- protected async Task HandleDocumentSymbolRequestAsync(
- DocumentSymbolParams documentSymbolParams,
- RequestContext requestContext)
- {
- ScriptFile scriptFile =
- editorSession.Workspace.GetFile(
- documentSymbolParams.TextDocument.Uri);
-
- IEnumerable foundSymbols =
- this.ProvideDocumentSymbols(scriptFile);
-
- SymbolInformation[] symbols = null;
-
- string containerName = Path.GetFileNameWithoutExtension(scriptFile.FilePath);
-
- if (foundSymbols != null)
- {
- symbols =
- foundSymbols
- .Select(r =>
- {
- return new SymbolInformation
- {
- ContainerName = containerName,
- Kind = Servers.LanguageServer.GetSymbolKind(r.SymbolType),
- Location = new Location
- {
- Uri = Servers.LanguageServer.GetFileUri(r.FilePath),
- Range = Servers.LanguageServer.GetRangeFromScriptRegion(r.ScriptRegion)
- },
- Name = Servers.LanguageServer.GetDecoratedSymbolName(r)
- };
- })
- .ToArray();
- }
- else
- {
- symbols = new SymbolInformation[0];
- }
-
- await requestContext.SendResultAsync(symbols);
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs b/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs
deleted file mode 100644
index b226fd0c4..000000000
--- a/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
-using Microsoft.PowerShell.EditorServices.Utility;
-using System.Threading.Tasks;
-using System;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.Client
-{
- public class DebugAdapterClient : IMessageSender, IMessageHandlers
- {
- private ILogger logger;
- private ProtocolEndpoint protocolEndpoint;
- private MessageDispatcher messageDispatcher;
-
- public DebugAdapterClient(ChannelBase clientChannel, ILogger logger)
- {
- this.logger = logger;
- this.messageDispatcher = new MessageDispatcher(logger);
- this.protocolEndpoint = new ProtocolEndpoint(
- clientChannel,
- messageDispatcher,
- logger);
- }
-
- public async Task StartAsync()
- {
- this.protocolEndpoint.Start();
-
- // Initialize the debug adapter
- await this.SendRequestAsync(
- InitializeRequest.Type,
- new InitializeRequestArguments
- {
- LinesStartAt1 = true,
- ColumnsStartAt1 = true
- },
- true);
- }
-
- public void Stop()
- {
- this.protocolEndpoint.Stop();
- }
-
- public async Task LaunchScriptAsync(string scriptFilePath)
- {
- await this.SendRequestAsync(
- LaunchRequest.Type,
- new LaunchRequestArguments {
- Script = scriptFilePath
- },
- true);
-
- await this.SendRequestAsync(
- ConfigurationDoneRequest.Type,
- null,
- true);
- }
-
- public Task SendEventAsync(NotificationType eventType, TParams eventParams)
- {
- return ((IMessageSender)protocolEndpoint).SendEventAsync(eventType, eventParams);
- }
-
- public Task SendRequestAsync(RequestType requestType, TParams requestParams, bool waitForResponse)
- {
- return ((IMessageSender)protocolEndpoint).SendRequestAsync(requestType, requestParams, waitForResponse);
- }
-
- public Task SendRequestAsync(RequestType0 requestType0)
- {
- return ((IMessageSender)protocolEndpoint).SendRequestAsync(requestType0);
- }
-
- public void SetRequestHandler(RequestType requestType, Func, Task> requestHandler)
- {
- ((IMessageHandlers)messageDispatcher).SetRequestHandler(requestType, requestHandler);
- }
-
- public void SetRequestHandler(RequestType0 requestType0, Func, Task> requestHandler)
- {
- ((IMessageHandlers)messageDispatcher).SetRequestHandler(requestType0, requestHandler);
- }
-
- public void SetEventHandler(NotificationType eventType, Func eventHandler)
- {
- ((IMessageHandlers)messageDispatcher).SetEventHandler(eventType, eventHandler);
- }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs b/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs
deleted file mode 100644
index 0ccb3d5b5..000000000
--- a/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
-using Microsoft.PowerShell.EditorServices.Utility;
-using System;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.Client
-{
- ///
- /// Provides a base implementation for language server clients.
- ///
- public abstract class LanguageClientBase : IMessageHandlers, IMessageSender
- {
- ILogger logger;
- private ProtocolEndpoint protocolEndpoint;
- private MessageDispatcher messageDispatcher;
-
- ///
- /// Initializes an instance of the language client using the
- /// specified channel for communication.
- ///
- /// The channel to use for communication with the server.
- public LanguageClientBase(ChannelBase clientChannel, ILogger logger)
- {
- this.logger = logger;
- this.messageDispatcher = new MessageDispatcher(logger);
- this.protocolEndpoint = new ProtocolEndpoint(
- clientChannel,
- messageDispatcher,
- logger);
- }
-
- public Task Start()
- {
- this.protocolEndpoint.Start();
-
- // Initialize the implementation class
- return this.InitializeAsync();
- }
-
- public async Task StopAsync()
- {
- await this.OnStopAsync();
-
- // First, notify the language server that we're stopping
- var response =
- await this.SendRequestAsync(
- ShutdownRequest.Type);
-
- await this.SendEventAsync(ExitNotification.Type, new object());
-
- this.protocolEndpoint.Stop();
- }
-
- protected virtual Task OnStopAsync()
- {
- return Task.FromResult(true);
- }
-
- protected virtual Task InitializeAsync()
- {
- return Task.FromResult(true);
- }
-
- public Task SendEventAsync(NotificationType eventType, TParams eventParams)
- {
- return ((IMessageSender)protocolEndpoint).SendEventAsync(eventType, eventParams);
- }
-
- public Task SendRequestAsync(RequestType requestType, TParams requestParams, bool waitForResponse)
- {
- return ((IMessageSender)protocolEndpoint).SendRequestAsync(requestType, requestParams, waitForResponse);
- }
-
- public Task SendRequestAsync(RequestType0 requestType0)
- {
- return ((IMessageSender)protocolEndpoint).SendRequestAsync(requestType0);
- }
-
- public void SetRequestHandler(RequestType requestType, Func, Task> requestHandler)
- {
- ((IMessageHandlers)messageDispatcher).SetRequestHandler(requestType, requestHandler);
- }
-
- public void SetRequestHandler(RequestType0 requestType0, Func, Task> requestHandler)
- {
- ((IMessageHandlers)messageDispatcher).SetRequestHandler(requestType0, requestHandler);
- }
-
- public void SetEventHandler(NotificationType eventType, Func eventHandler)
- {
- ((IMessageHandlers)messageDispatcher).SetEventHandler(eventType, eventHandler);
- }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/Client/LanguageServiceClient.cs b/src/PowerShellEditorServices.Protocol/Client/LanguageServiceClient.cs
deleted file mode 100644
index e2b1491fd..000000000
--- a/src/PowerShellEditorServices.Protocol/Client/LanguageServiceClient.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.PowerShell.EditorServices.Utility;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.Client
-{
- public class LanguageServiceClient : LanguageClientBase
- {
- private Dictionary cachedDiagnostics =
- new Dictionary();
-
- public LanguageServiceClient(ChannelBase clientChannel, ILogger logger)
- : base(clientChannel, logger)
- {
- }
-
- protected override Task InitializeAsync()
- {
- // Add handlers for common events
- this.SetEventHandler(PublishDiagnosticsNotification.Type, HandlePublishDiagnosticsEventAsync);
-
- // Send the 'initialize' request and wait for the response
- var initializeParams = new InitializeParams
- {
- RootPath = "",
- Capabilities = new ClientCapabilities()
- };
-
- return this.SendRequestAsync(
- InitializeRequest.Type,
- initializeParams,
- true);
- }
-
- #region Events
-
- public event EventHandler DiagnosticsReceived;
-
- protected void OnDiagnosticsReceived(string filePath)
- {
- if (this.DiagnosticsReceived != null)
- {
- this.DiagnosticsReceived(this, filePath);
- }
- }
-
- #endregion
-
- #region Private Methods
-
- private Task HandlePublishDiagnosticsEventAsync(
- PublishDiagnosticsNotification diagnostics,
- EventContext eventContext)
- {
- string normalizedPath = diagnostics.Uri.ToLower();
-
- this.cachedDiagnostics[normalizedPath] =
- diagnostics.Diagnostics
- .Select(GetMarkerFromDiagnostic)
- .ToArray();
-
- this.OnDiagnosticsReceived(normalizedPath);
-
- return Task.FromResult(true);
- }
-
- private static ScriptFileMarker GetMarkerFromDiagnostic(Diagnostic diagnostic)
- {
- DiagnosticSeverity severity =
- diagnostic.Severity.GetValueOrDefault(
- DiagnosticSeverity.Error);
-
- return new ScriptFileMarker
- {
- Level = MapDiagnosticSeverityToLevel(severity),
- Message = diagnostic.Message,
- ScriptRegion = new ScriptRegion
- {
- StartLineNumber = diagnostic.Range.Start.Line + 1,
- StartColumnNumber = diagnostic.Range.Start.Character + 1,
- EndLineNumber = diagnostic.Range.End.Line + 1,
- EndColumnNumber = diagnostic.Range.End.Character + 1
- }
- };
- }
-
- private static ScriptFileMarkerLevel MapDiagnosticSeverityToLevel(DiagnosticSeverity severity)
- {
- switch (severity)
- {
- case DiagnosticSeverity.Hint:
- case DiagnosticSeverity.Information:
- return ScriptFileMarkerLevel.Information;
-
- case DiagnosticSeverity.Warning:
- return ScriptFileMarkerLevel.Warning;
-
- case DiagnosticSeverity.Error:
- return ScriptFileMarkerLevel.Error;
-
- default:
- return ScriptFileMarkerLevel.Error;
- }
- }
-
- #endregion
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/AttachRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/AttachRequest.cs
deleted file mode 100644
index 4c805a2b1..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/AttachRequest.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class AttachRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("attach");
- }
-
- public class AttachRequestArguments
- {
- public string ComputerName { get; set; }
-
- public string ProcessId { get; set; }
-
- public string RunspaceId { get; set; }
-
- public string RunspaceName { get; set; }
-
- public string CustomPipeName { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/Breakpoint.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/Breakpoint.cs
deleted file mode 100644
index 0eeb00d8f..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/Breakpoint.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Utility;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class Breakpoint
- {
- public int? Id { get; set; }
-
- ///
- /// Gets an boolean indicator that if true, breakpoint could be set
- /// (but not necessarily at the desired location).
- ///
- public bool Verified { get; set; }
-
- ///
- /// Gets an optional message about the state of the breakpoint. This is shown to the user
- /// and can be used to explain why a breakpoint could not be verified.
- ///
- public string Message { get; set; }
-
- public Source Source { get; set; }
-
- public int? Line { get; set; }
-
- public int? Column { get; set; }
-
- private Breakpoint()
- {
- }
-
- public static Breakpoint Create(
- BreakpointDetails breakpointDetails)
- {
- Validate.IsNotNull(nameof(breakpointDetails), breakpointDetails);
-
- return new Breakpoint
- {
- Id = breakpointDetails.Id,
- Verified = breakpointDetails.Verified,
- Message = breakpointDetails.Message,
- Source = new Source { Path = breakpointDetails.Source },
- Line = breakpointDetails.LineNumber,
- Column = breakpointDetails.ColumnNumber
- };
- }
-
- public static Breakpoint Create(
- CommandBreakpointDetails breakpointDetails)
- {
- Validate.IsNotNull(nameof(breakpointDetails), breakpointDetails);
-
- return new Breakpoint {
- Verified = breakpointDetails.Verified,
- Message = breakpointDetails.Message
- };
- }
-
- public static Breakpoint Create(
- SourceBreakpoint sourceBreakpoint,
- string source,
- string message,
- bool verified = false)
- {
- Validate.IsNotNull(nameof(sourceBreakpoint), sourceBreakpoint);
- Validate.IsNotNull(nameof(source), source);
- Validate.IsNotNull(nameof(message), message);
-
- return new Breakpoint {
- Verified = verified,
- Message = message,
- Source = new Source { Path = source },
- Line = sourceBreakpoint.Line,
- Column = sourceBreakpoint.Column
- };
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/BreakpointEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/BreakpointEvent.cs
deleted file mode 100644
index a339a70d9..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/BreakpointEvent.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class BreakpointEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("breakpoint");
-
- public string Reason { get; set; }
-
- public Breakpoint Breakpoint { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/ConfigurationDoneRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/ConfigurationDoneRequest.cs
deleted file mode 100644
index 11cbc4ded..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/ConfigurationDoneRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class ConfigurationDoneRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("configurationDone");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/ContinueRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/ContinueRequest.cs
deleted file mode 100644
index 3f9dbc59c..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/ContinueRequest.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class ContinueRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("continue");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/ContinuedEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/ContinuedEvent.cs
deleted file mode 100644
index af442750f..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/ContinuedEvent.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class ContinuedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("continued");
-
- public int ThreadId { get; set; }
-
- public bool AllThreadsContinued { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/DisconnectRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/DisconnectRequest.cs
deleted file mode 100644
index 2235206cd..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/DisconnectRequest.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class DisconnectRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("disconnect");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/ExitedEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/ExitedEvent.cs
deleted file mode 100644
index 9f1a0d6ce..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/ExitedEvent.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class ExitedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("exited");
- }
-
- public class ExitedEventBody
- {
- public int ExitCode { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/InitializeRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/InitializeRequest.cs
deleted file mode 100644
index 7904759d9..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/InitializeRequest.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class InitializeRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("initialize");
- }
-
- public class InitializeRequestArguments
- {
- public string AdapterId { get; set; }
-
- public bool LinesStartAt1 { get; set; }
-
- public bool ColumnsStartAt1 { get; set; }
-
- public string PathFormat { get; set; }
-
- public bool SourceMaps { get; set; }
-
- public string GeneratedCodeDirectory { get; set; }
- }
-
- public class InitializeResponseBody
- {
- ///
- /// Gets or sets a boolean value that determines whether the debug adapter
- /// supports the configurationDoneRequest.
- ///
- public bool SupportsConfigurationDoneRequest { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether the debug adapter
- /// supports functionBreakpoints.
- ///
- public bool SupportsFunctionBreakpoints { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether the debug adapter
- /// supports conditionalBreakpoints.
- ///
- public bool SupportsConditionalBreakpoints { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether the debug adapter
- /// supports breakpoints that break execution after a specified number of hits.
- ///
- public bool SupportsHitConditionalBreakpoints { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether the debug adapter
- /// supports a (side effect free) evaluate request for data hovers.
- ///
- public bool SupportsEvaluateForHovers { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether the debug adapter
- /// supports allowing the user to set a variable from the Variables debug windows.
- ///
- public bool SupportsSetVariable { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/InitializedEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/InitializedEvent.cs
deleted file mode 100644
index 7253b7b30..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/InitializedEvent.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class InitializedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("initialized");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/LaunchRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/LaunchRequest.cs
deleted file mode 100644
index 1bf5c9ea1..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/LaunchRequest.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System;
-using System.Collections.Generic;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class LaunchRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("launch");
- }
-
- public class LaunchRequestArguments
- {
- ///
- /// Gets or sets the absolute path to the script to debug.
- ///
- public string Script { get; set; }
-
- ///
- /// Gets or sets a boolean value that indicates whether the script should be
- /// run with (false) or without (true) debugging support.
- ///
- public bool NoDebug { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether to automatically stop
- /// target after launch. If not specified, target does not stop.
- ///
- public bool StopOnEntry { get; set; }
-
- ///
- /// Gets or sets optional arguments passed to the debuggee.
- ///
- public string[] Args { get; set; }
-
- ///
- /// Gets or sets the working directory of the launched debuggee (specified as an absolute path).
- /// If omitted the debuggee is lauched in its own directory.
- ///
- public string Cwd { get; set; }
-
- ///
- /// Gets or sets a boolean value that determines whether to create a temporary
- /// integrated console for the debug session. Default is false.
- ///
- public bool CreateTemporaryIntegratedConsole { get; set; }
-
- ///
- /// Gets or sets the absolute path to the runtime executable to be used.
- /// Default is the runtime executable on the PATH.
- ///
- public string RuntimeExecutable { get; set; }
-
- ///
- /// Gets or sets the optional arguments passed to the runtime executable.
- ///
- public string[] RuntimeArgs { get; set; }
-
- ///
- /// Gets or sets optional environment variables to pass to the debuggee. The string valued
- /// properties of the 'environmentVariables' are used as key/value pairs.
- ///
- public Dictionary Env { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/NextRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/NextRequest.cs
deleted file mode 100644
index 1a254b96f..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/NextRequest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- // /** StepOver request; value of command field is "next".
- // he request starts the debuggee to run again for one step.
- // penDebug will respond with a StoppedEvent (event type 'step') after running the step.
- public class NextRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("next");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/OutputEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/OutputEvent.cs
deleted file mode 100644
index 0044855c4..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/OutputEvent.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class OutputEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("output");
- }
-
- public class OutputEventBody
- {
- public string Category { get; set; }
-
- public string Output { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/PauseRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/PauseRequest.cs
deleted file mode 100644
index 6fa67c584..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/PauseRequest.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class PauseRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("pause");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/Scope.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/Scope.cs
deleted file mode 100644
index 5413869f4..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/Scope.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class Scope
- {
- ///
- /// Gets or sets the name of the scope (as such 'Arguments', 'Locals')
- ///
- public string Name { get; set; }
-
- ///
- /// Gets or sets the variables of this scope can be retrieved by passing the
- /// value of variablesReference to the VariablesRequest.
- ///
- public int VariablesReference { get; set; }
-
- ///
- /// Gets or sets a boolean value indicating if number of variables in
- /// this scope is large or expensive to retrieve.
- ///
- public bool Expensive { get; set; }
-
- public static Scope Create(VariableScope scope)
- {
- return new Scope {
- Name = scope.Name,
- VariablesReference = scope.Id,
- // Temporary fix for #95 to get debug hover tips to work well at least for the local scope.
- Expensive = ((scope.Name != VariableContainerDetails.LocalScopeName) &&
- (scope.Name != VariableContainerDetails.AutoVariablesName))
- };
- }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/ScopesRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/ScopesRequest.cs
deleted file mode 100644
index 4905ffdfe..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/ScopesRequest.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Diagnostics;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class ScopesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("scopes");
- }
-
- [DebuggerDisplay("FrameId = {FrameId}")]
- public class ScopesRequestArguments
- {
- public int FrameId { get; set; }
- }
-
- public class ScopesResponseBody
- {
- public Scope[] Scopes { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetBreakpointsRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/SetBreakpointsRequest.cs
deleted file mode 100644
index 82d41ac53..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetBreakpointsRequest.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- ///
- /// SetBreakpoints request; value of command field is "setBreakpoints".
- /// Sets multiple breakpoints for a single source and clears all previous breakpoints in that source.
- /// To clear all breakpoint for a source, specify an empty array.
- /// When a breakpoint is hit, a StoppedEvent (event type 'breakpoint') is generated.
- ///
- public class SetBreakpointsRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("setBreakpoints");
- }
-
- public class SetBreakpointsRequestArguments
- {
- public Source Source { get; set; }
-
- public SourceBreakpoint[] Breakpoints { get; set; }
- }
-
- public class SourceBreakpoint
- {
- public int Line { get; set; }
-
- public int? Column { get; set; }
-
- public string Condition { get; set; }
-
- public string HitCondition { get; set; }
- }
-
- public class SetBreakpointsResponseBody
- {
- public Breakpoint[] Breakpoints { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetExceptionBreakpointsRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/SetExceptionBreakpointsRequest.cs
deleted file mode 100644
index 6a7313324..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetExceptionBreakpointsRequest.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- ///
- /// SetExceptionBreakpoints request; value of command field is "setExceptionBreakpoints".
- /// Enable that the debuggee stops on exceptions with a StoppedEvent (event type 'exception').
- ///
- public class SetExceptionBreakpointsRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("setExceptionBreakpoints");
- }
-
- ///
- /// Arguments for "setExceptionBreakpoints" request.
- ///
- public class SetExceptionBreakpointsRequestArguments
- {
- ///
- /// Gets or sets the names of enabled exception breakpoints.
- ///
- public string[] Filters { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetFunctionBreakpointsRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/SetFunctionBreakpointsRequest.cs
deleted file mode 100644
index 6fb951553..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetFunctionBreakpointsRequest.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class SetFunctionBreakpointsRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("setFunctionBreakpoints");
- }
-
- public class SetFunctionBreakpointsRequestArguments
- {
- public FunctionBreakpoint[] Breakpoints { get; set; }
- }
-
- public class FunctionBreakpoint
- {
- ///
- /// Gets or sets the name of the function to break on when it is invoked.
- ///
- public string Name { get; set; }
-
- public string Condition { get; set; }
-
- public string HitCondition { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetVariableRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/SetVariableRequest.cs
deleted file mode 100644
index 47e41cb36..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/SetVariableRequest.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Diagnostics;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- ///
- /// SetVariable request; value of command field is "setVariable".
- /// Request is initiated when user uses the debugger Variables UI to change the value of a variable.
- ///
- public class SetVariableRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("setVariable");
- }
-
- [DebuggerDisplay("VariablesReference = {VariablesReference}")]
- public class SetVariableRequestArguments
- {
- public int VariablesReference { get; set; }
-
- public string Name { get; set; }
-
- public string Value { get; set; }
- }
-
- public class SetVariableResponseBody
- {
- public string Value { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/Source.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/Source.cs
deleted file mode 100644
index 29f21bdf9..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/Source.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class Source
- {
- public string Name { get; set; }
-
- public string Path { get; set; }
-
- public int? SourceReference { get; set; }
-
- ///
- /// Gets an optional hint for how to present the source in the UI. A value of 'deemphasize'
- /// can be used to indicate that the source is not available or that it is skipped on stepping.
- ///
- public string PresentationHint { get; set; }
- }
-
- ///
- /// An optional hint for how to present source in the UI.
- ///
- public enum SourcePresentationHint
- {
- ///
- /// Dispays the source normally.
- ///
- Normal,
-
- ///
- /// Display the source emphasized.
- ///
- Emphasize,
-
- ///
- /// Display the source deemphasized.
- ///
- Deemphasize
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/SourceRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/SourceRequest.cs
deleted file mode 100644
index 48a2b0a17..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/SourceRequest.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class SourceRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("source");
- }
-
- public class SourceRequestArguments
- {
- ///
- /// Gets or sets the reference to the source. This is the value received in Source.reference.
- ///
- public int SourceReference { get; set; }
- }
-
- public class SourceResponseBody
- {
- public string Content { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/StackFrame.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/StackFrame.cs
deleted file mode 100644
index 4c8d80d81..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/StackFrame.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class StackFrame
- {
- ///
- /// Gets or sets an identifier for the stack frame. It must be unique across all threads.
- /// This id can be used to retrieve the scopes of the frame with the 'scopesRequest' or
- /// to restart the execution of a stackframe. */
- ///
- public int Id { get; set; }
-
- ///
- /// Gets or sets the name of the stack frame, typically a method name
- ///
- public string Name { get; set; }
-
- ///
- /// Gets or sets the optional source of the frame.
- ///
- public Source Source { get; set; }
-
- ///
- /// Gets or sets line within the file of the frame. If source is null or doesn't exist,
- /// line is 0 and must be ignored.
- ///
- public int Line { get; set; }
-
- ///
- /// Gets or sets an optional end line of the range covered by the stack frame.
- ///
- public int? EndLine { get; set; }
-
- ///
- /// Gets or sets the column within the line. If source is null or doesn't exist,
- /// column is 0 and must be ignored.
- ///
- public int Column { get; set; }
-
- ///
- /// Gets or sets an optional end column of the range covered by the stack frame.
- ///
- public int? EndColumn { get; set; }
-
- ///
- /// Gets an optional hint for how to present this frame in the UI. A value of 'label'
- /// can be used to indicate that the frame is an artificial frame that is used as a
- /// visual label or separator. A value of 'subtle' can be used to change the appearance
- /// of a frame in a 'subtle' way.
- ///
- public string PresentationHint { get; private set; }
-
- public static StackFrame Create(
- StackFrameDetails stackFrame,
- int id)
- {
- var sourcePresentationHint =
- stackFrame.IsExternalCode ? SourcePresentationHint.Deemphasize : SourcePresentationHint.Normal;
-
- // When debugging an interactive session, the ScriptPath is which is not a valid source file.
- // We need to make sure the user can't open the file associated with this stack frame.
- // It will generate a VSCode error in this case.
- Source source = null;
- if (!stackFrame.ScriptPath.Contains("<"))
- {
- source = new Source
- {
- Path = stackFrame.ScriptPath,
- PresentationHint = sourcePresentationHint.ToString().ToLower()
- };
- }
-
- return new StackFrame
- {
- Id = id,
- Name = (source != null) ? stackFrame.FunctionName : "Interactive Session",
- Line = (source != null) ? stackFrame.StartLineNumber : 0,
- EndLine = stackFrame.EndLineNumber,
- Column = (source != null) ? stackFrame.StartColumnNumber : 0,
- EndColumn = stackFrame.EndColumnNumber,
- Source = source
- };
- }
- }
-
- ///
- /// An optional hint for how to present a stack frame in the UI.
- ///
- public enum StackFramePresentationHint
- {
- ///
- /// Dispays the stack frame as a normal stack frame.
- ///
- Normal,
-
- ///
- /// Used to label an entry in the call stack that doesn't actually correspond to a stack frame.
- /// This is typically used to label transitions to/from "external" code.
- ///
- Label,
-
- ///
- /// Displays the stack frame in a subtle way, typically used from loctaions outside of the current project or workspace.
- ///
- Subtle
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/StackTraceRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/StackTraceRequest.cs
deleted file mode 100644
index 56a88a950..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/StackTraceRequest.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Diagnostics;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class StackTraceRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("stackTrace");
- }
-
- [DebuggerDisplay("ThreadId = {ThreadId}, Levels = {Levels}")]
- public class StackTraceRequestArguments
- {
- ///
- /// Gets or sets the ThreadId of this stacktrace.
- ///
- public int ThreadId { get; set; }
-
- ///
- /// Gets or sets the index of the first frame to return. If omitted frames start at 0.
- ///
- public int? StartFrame { get; set; }
-
- ///
- /// Gets or sets the maximum number of frames to return. If levels is not specified or 0, all frames are returned.
- ///
- public int? Levels { get; set; }
-
- ///
- /// Gets or sets the format string that specifies details on how to format the stack frames.
- ///
- public string Format { get; set; }
- }
-
- public class StackTraceResponseBody
- {
- ///
- /// Gets the frames of the stackframe. If the array has length zero, there are no stackframes available.
- /// This means that there is no location information available.
- ///
- public StackFrame[] StackFrames { get; set; }
-
- ///
- /// Gets the total number of frames available.
- ///
- public int? TotalFrames { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/StartedEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/StartedEvent.cs
deleted file mode 100644
index 5b32d4a84..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/StartedEvent.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class StartedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("started");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/StepInRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/StepInRequest.cs
deleted file mode 100644
index ec825ebbd..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/StepInRequest.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class StepInRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("stepIn");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/StepOutRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/StepOutRequest.cs
deleted file mode 100644
index be0a31807..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/StepOutRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class StepOutRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("stepOut");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/StoppedEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/StoppedEvent.cs
deleted file mode 100644
index a3c2a7921..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/StoppedEvent.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class StoppedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("stopped");
- }
-
- public class StoppedEventBody
- {
- ///
- /// A value such as "step", "breakpoint", "exception", or "pause"
- ///
- public string Reason { get; set; }
-
- ///
- /// Gets or sets the current thread ID, if any.
- ///
- public int? ThreadId { get; set; }
-
- public Source Source { get; set; }
-
- ///
- /// Gets or sets additional information such as an error message.
- ///
- public string Text { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/TerminatedEvent.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/TerminatedEvent.cs
deleted file mode 100644
index 514d0bcae..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/TerminatedEvent.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class TerminatedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("terminated");
-
- public bool Restart { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/Thread.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/Thread.cs
deleted file mode 100644
index 35a8a139d..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/Thread.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class Thread
- {
- public int Id { get; set; }
-
- public string Name { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/ThreadsRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/ThreadsRequest.cs
deleted file mode 100644
index 24432d671..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/ThreadsRequest.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class ThreadsRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("threads");
- }
-
- public class ThreadsResponseBody
- {
- public Thread[] Threads { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs
deleted file mode 100644
index a335b0975..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/Variable.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class Variable
- {
- public string Name { get; set; }
-
- // /** The variable's value. For structured objects this can be a multi line text, e.g. for a function the body of a function. */
- public string Value { get; set; }
-
- ///
- /// Gets or sets the type of the variable's value. Typically shown in the UI when hovering over the value.
- ///
- public string Type { get; set; }
-
- ///
- /// Gets or sets the evaluatable name for the variable that will be evaluated by the debugger.
- ///
- public string EvaluateName { get; set; }
-
- // /** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */
- public int VariablesReference { get; set; }
-
- public static Variable Create(VariableDetailsBase variable)
- {
- return new Variable
- {
- Name = variable.Name,
- Value = variable.ValueString ?? string.Empty,
- Type = variable.Type,
- EvaluateName = variable.Name,
- VariablesReference =
- variable.IsExpandable ?
- variable.Id : 0
- };
- }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/DebugAdapter/VariablesRequest.cs b/src/PowerShellEditorServices.Protocol/DebugAdapter/VariablesRequest.cs
deleted file mode 100644
index f387c500f..000000000
--- a/src/PowerShellEditorServices.Protocol/DebugAdapter/VariablesRequest.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Diagnostics;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
-{
- public class VariablesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("variables");
- }
-
- [DebuggerDisplay("VariablesReference = {VariablesReference}")]
- public class VariablesRequestArguments
- {
- public int VariablesReference { get; set; }
- }
-
- public class VariablesResponseBody
- {
- public Variable[] Variables { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ClientCapabilities.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ClientCapabilities.cs
deleted file mode 100644
index f66982c43..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ClientCapabilities.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Defines a class that describes the capabilities of a language
- /// client. At this time no specific capabilities are listed for
- /// clients.
- ///
- public class ClientCapabilities
- {
- public WorkspaceClientCapabilities Workspace { get; set; }
- public TextDocumentClientCapabilities TextDocument { get; set; }
- public object Experimental { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/CodeAction.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/CodeAction.cs
deleted file mode 100644
index a382d8dcf..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/CodeAction.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class CodeActionRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/codeAction");
- }
-
- ///
- /// Parameters for CodeActionRequest.
- ///
- public class CodeActionParams
- {
- ///
- /// The document in which the command was invoked.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
-
- ///
- /// The range for which the command was invoked.
- ///
- public Range Range { get; set; }
-
- ///
- /// Context carrying additional information.
- ///
- public CodeActionContext Context { get; set; }
- }
-
- public class CodeActionContext
- {
- public Diagnostic[] Diagnostics { get; set; }
- }
-
- public class CodeActionCommand
- {
- public string Title { get; set; }
-
- public string Command { get; set; }
-
- public JArray Arguments { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/CodeLens.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/CodeLens.cs
deleted file mode 100644
index fd12f284d..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/CodeLens.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Code Lens options.
- ///
- public class CodeLensOptions
- {
- ///
- /// Code lens has a resolve provider as well.
- ///
- public bool ResolveProvider { get; set; }
- }
-
- public class CodeLens
- {
- public Range Range { get; set; }
-
- public ServerCommand Command { get; set; }
-
- public JToken Data { get; set; }
- }
-
- ///
- /// A code lens represents a command that should be shown along with
- /// source text, like the number of references, a way to run tests, etc.
- ///
- /// A code lens is _unresolved_ when no command is associated to it. For performance
- /// reasons the creation of a code lens and resolving should be done in two stages.
- ///
- public class CodeLensRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/codeLens");
-
- ///
- /// The document to request code lens for.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
- }
-
- public class CodeLensResolveRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("codeLens/resolve");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/CommentHelpRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/CommentHelpRequest.cs
deleted file mode 100644
index d4406519f..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/CommentHelpRequest.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- class CommentHelpRequest
- {
- public static readonly RequestType Type
- = RequestType.Create("powerShell/getCommentHelp");
- }
-
- public class CommentHelpRequestResult
- {
- public string[] Content { get; set; }
- }
-
- public class CommentHelpRequestParams
- {
- public string DocumentUri { get; set; }
- public Position TriggerPosition { get; set; }
- public bool BlockComment { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Completion.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Completion.cs
deleted file mode 100644
index 2e0cbeeca..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Completion.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Diagnostics;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class CompletionRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/completion");
- }
-
- public class CompletionResolveRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("completionItem/resolve");
- }
-
- ///
- /// Completion registration options.
- ///
- public class CompletionRegistrationOptions : TextDocumentRegistrationOptions
- {
- // We duplicate the properties of completionOptions class here because
- // we cannot derive from two classes. One way to get around this situation
- // is to use define CompletionOptions as an interface instead of a class.
- public bool? ResolveProvider { get; set; }
-
- public string[] TriggerCharacters { get; set; }
- }
-
- public enum CompletionItemKind
- {
- Text = 1,
- Method = 2,
- Function = 3,
- Constructor = 4,
- Field = 5,
- Variable = 6,
- Class = 7,
- Interface = 8,
- Module = 9,
- Property = 10,
- Unit = 11,
- Value = 12,
- Enum = 13,
- Keyword = 14,
- Snippet = 15,
- Color = 16,
- File = 17,
- Reference = 18,
- Folder = 19
- }
-
- public enum InsertTextFormat
- {
- PlainText = 1,
- Snippet = 2,
- }
-
- [DebuggerDisplay("NewText = {NewText}, Range = {Range.Start.Line}:{Range.Start.Character} - {Range.End.Line}:{Range.End.Character}")]
- public class TextEdit
- {
- public Range Range { get; set; }
-
- public string NewText { get; set; }
- }
-
- [DebuggerDisplay("Kind = {Kind.ToString()}, Label = {Label}, Detail = {Detail}")]
- public class CompletionItem
- {
- public string Label { get; set; }
-
- public CompletionItemKind? Kind { get; set; }
-
- public string Detail { get; set; }
-
- ///
- /// Gets or sets the documentation string for the completion item.
- ///
- public string Documentation { get; set; }
-
- public string SortText { get; set; }
-
- public string FilterText { get; set; }
-
- public string InsertText { get; set; }
-
- public InsertTextFormat InsertTextFormat { get; set; } = InsertTextFormat.PlainText;
-
- public Range Range { get; set; }
-
- public string[] CommitCharacters { get; set; }
-
- public TextEdit TextEdit { get; set; }
-
- public TextEdit[] AdditionalTextEdits { get; set; }
-
- public CommandType Command { get; set; }
-
- ///
- /// Gets or sets a custom data field that allows the server to mark
- /// each completion item with an identifier that will help correlate
- /// the item to the previous completion request during a completion
- /// resolve request.
- ///
- public object Data { get; set; }
- }
-
- ///
- /// Represents a reference to a command. Provides a title which will be used to
- /// represent a command in the UI and, optionally, an array of arguments which
- /// will be passed to the command handler function when invoked.
- ///
- /// The name of the corresponding type in vscode-languageserver-node is Command
- /// but since .net does not allow a property name (Command) and its enclosing
- /// type name to be the same we change its name to CommandType.
- ///
- public class CommandType
- {
- ///
- /// Title of the command.
- ///
- ///
- public string Title { get; set; }
-
- ///
- /// The identifier of the actual command handler.
- ///
- public string Command { get; set; }
-
- ///
- /// Arguments that the command handler should be invoked with.
- ///
- public object[] Arguments { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Configuration.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Configuration.cs
deleted file mode 100644
index a4228ee19..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Configuration.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class DidChangeConfigurationNotification
- {
- public static readonly
- NotificationType, object> Type =
- NotificationType, object>.Create("workspace/didChangeConfiguration");
- }
-
- public class DidChangeConfigurationParams
- {
- public TConfig Settings { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs
deleted file mode 100644
index cee9a7215..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class DefinitionRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/definition");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Diagnostics.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Diagnostics.cs
deleted file mode 100644
index e5e46d45f..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Diagnostics.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class PublishDiagnosticsNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("textDocument/publishDiagnostics");
-
- ///
- /// Gets or sets the URI for which diagnostic information is reported.
- ///
- public string Uri { get; set; }
-
- ///
- /// Gets or sets the array of diagnostic information items.
- ///
- public Diagnostic[] Diagnostics { get; set; }
- }
-
- public enum DiagnosticSeverity
- {
- ///
- /// Indicates that the diagnostic represents an error.
- ///
- Error = 1,
-
- ///
- /// Indicates that the diagnostic represents a warning.
- ///
- Warning = 2,
-
- ///
- /// Indicates that the diagnostic represents an informational message.
- ///
- Information = 3,
-
- ///
- /// Indicates that the diagnostic represents a hint.
- ///
- Hint = 4
- }
-
- public class Diagnostic
- {
- public Range Range { get; set; }
-
- ///
- /// Gets or sets the severity of the diagnostic. If omitted, the
- /// client should interpret the severity.
- ///
- public DiagnosticSeverity? Severity { get; set; }
-
- ///
- /// Gets or sets the diagnostic's code (optional).
- ///
- public string Code { get; set; }
-
- ///
- /// Gets or sets the diagnostic message.
- ///
- public string Message { get; set; }
-
- ///
- /// Gets or sets the source of the diagnostic message.
- ///
- public string Source { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/DocumentHighlight.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/DocumentHighlight.cs
deleted file mode 100644
index cf8196f18..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/DocumentHighlight.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public enum DocumentHighlightKind
- {
- Text = 1,
- Read = 2,
- Write = 3
- }
-
- public class DocumentHighlight
- {
- public Range Range { get; set; }
-
- public DocumentHighlightKind Kind { get; set; }
- }
-
- public class DocumentHighlightRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/documentHighlight");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/DynamicRegistrationCapability.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/DynamicRegistrationCapability.cs
deleted file mode 100644
index 64d2c35ce..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/DynamicRegistrationCapability.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Class to represent if a capability supports dynamic registration.
- ///
- public class DynamicRegistrationCapability
- {
- ///
- /// Whether the capability supports dynamic registration.
- ///
- public bool? DynamicRegistration { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/EditorCommands.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/EditorCommands.cs
deleted file mode 100644
index a7c385bc6..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/EditorCommands.cs
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class ExtensionCommandAddedNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("powerShell/extensionCommandAdded");
-
- public string Name { get; set; }
-
- public string DisplayName { get; set; }
- }
-
- public class ExtensionCommandUpdatedNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("powerShell/extensionCommandUpdated");
-
- public string Name { get; set; }
- }
-
- public class ExtensionCommandRemovedNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("powerShell/extensionCommandRemoved");
-
- public string Name { get; set; }
- }
-
- public class ClientEditorContext
- {
- public string CurrentFileContent { get; set; }
-
- public string CurrentFileLanguage { get; set; }
-
- public string CurrentFilePath { get; set; }
-
- public Position CursorPosition { get; set; }
-
- public Range SelectionRange { get; set; }
-
- }
-
- public class InvokeExtensionCommandRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/invokeExtensionCommand");
-
- public string Name { get; set; }
-
- public ClientEditorContext Context { get; set; }
- }
-
- public class GetEditorContextRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/getEditorContext");
- }
-
- public enum EditorCommandResponse
- {
- Unsupported,
- OK
- }
-
- public class InsertTextRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/insertText");
-
- public string FilePath { get; set; }
-
- public string InsertText { get; set; }
-
- public Range InsertRange { get; set; }
- }
-
- public class SetSelectionRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/setSelection");
-
- public Range SelectionRange { get; set; }
- }
-
- public class SetCursorPositionRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/setCursorPosition");
-
- public Position CursorPosition { get; set; }
- }
-
- public class NewFileRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/newFile");
- }
-
- public class OpenFileRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/openFile");
- }
-
- public class OpenFileDetails
- {
- public string FilePath { get; set; }
-
- public bool Preview { get; set; }
- }
-
- public class CloseFileRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/closeFile");
- }
-
- public class SaveFileRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/saveFile");
- }
-
- public class SaveFileDetails
- {
- public string FilePath { get; set; }
-
- public string NewPath { get; set; }
- }
-
- public class ShowInformationMessageRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/showInformationMessage");
- }
-
- public class ShowWarningMessageRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/showWarningMessage");
- }
-
- public class ShowErrorMessageRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/showErrorMessage");
- }
-
- public class SetStatusBarMessageRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("editor/setStatusBarMessage");
- }
-
- public class StatusBarMessageDetails
- {
- public string Message { get; set; }
-
- public int? Timeout { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ExecutionStatusChangedEvent.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ExecutionStatusChangedEvent.cs
deleted file mode 100644
index 5ac6eac6d..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ExecutionStatusChangedEvent.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Defines an event type for PowerShell context execution status changes (e.g. execution has completed)
- ///
- public class ExecutionStatusChangedEvent
- {
- ///
- /// The notification type for execution status change events in the message protocol
- ///
- public static readonly
- NotificationType Type =
- NotificationType.Create("powerShell/executionStatusChanged");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ExpandAliasRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ExpandAliasRequest.cs
deleted file mode 100644
index d5c2a9bc9..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ExpandAliasRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class ExpandAliasRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/expandAlias");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/FindModuleRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/FindModuleRequest.cs
deleted file mode 100644
index fe14fdb65..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/FindModuleRequest.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using System.Collections.Generic;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class FindModuleRequest
- {
- public static readonly
- RequestType, object, object, object> Type =
- RequestType, object, object, object>.Create("powerShell/findModule");
- }
-
-
- public class PSModuleMessage
- {
- public string Name { get; set; }
- public string Description { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Folding.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Folding.cs
deleted file mode 100644
index f7b1d8f01..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Folding.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class FoldingRangeRequest
- {
- ///
- /// A request to provide folding ranges in a document. The request's
- /// parameter is of type [FoldingRangeParams](#FoldingRangeParams), the
- /// response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable
- /// that resolves to such.
- /// Ref: https://github.com/Microsoft/vscode-languageserver-node/blob/5350bc2ffe8afb17357c1a66fbdd3845fa05adfd/protocol/src/protocol.foldingRange.ts#L112-L120
- ///
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/foldingRange");
- }
-
- ///
- /// Parameters for a [FoldingRangeRequest](#FoldingRangeRequest).
- /// Ref: https://github.com/Microsoft/vscode-languageserver-node/blob/5350bc2ffe8afb17357c1a66fbdd3845fa05adfd/protocol/src/protocol.foldingRange.ts#L102-L110
- ///
- public class FoldingRangeParams
- {
- ///
- /// The text document
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
- }
-
- ///
- /// Represents a folding range.
- /// Ref: https://github.com/Microsoft/vscode-languageserver-node/blob/5350bc2ffe8afb17357c1a66fbdd3845fa05adfd/protocol/src/protocol.foldingRange.ts#L69-L100
- ///
- public class FoldingRange
- {
- ///
- /// The zero-based line number from where the folded range starts.
- ///
- public int StartLine { get; set; }
-
- ///
- /// The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
- ///
- public int StartCharacter { get; set; }
-
- ///
- /// The zero-based line number where the folded range ends.
- ///
- public int EndLine { get; set; }
-
- ///
- /// The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
- ///
- public int EndCharacter { get; set; }
-
- ///
- /// Describes the kind of the folding range such as `comment' or 'region'. The kind
- /// is used to categorize folding ranges and used by commands like 'Fold all comments'. See
- /// [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
- ///
- public string Kind { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Formatting.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Formatting.cs
deleted file mode 100644
index f063ba163..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Formatting.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class DocumentFormattingRequest
- {
- public static readonly RequestType Type = RequestType.Create("textDocument/formatting");
- }
-
- public class DocumentRangeFormattingRequest
- {
- public static readonly RequestType Type = RequestType.Create("textDocument/rangeFormatting");
-
- }
-
- public class DocumentOnTypeFormattingRequest
- {
- public static readonly RequestType Type = RequestType.Create("textDocument/onTypeFormatting");
-
- }
-
- public class DocumentRangeFormattingParams
- {
- ///
- /// The document to format.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
-
- ///
- /// The range to format.
- ///
- ///
- public Range Range { get; set; }
-
- ///
- /// The format options.
- ///
- public FormattingOptions Options { get; set; }
- }
-
- public class DocumentOnTypeFormattingParams
- {
- ///
- /// The document to format.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
-
- ///
- /// The position at which this request was sent.
- ///
- public Position Position { get; set; }
-
- ///
- /// The character that has been typed.
- ///
- public string ch { get; set; }
-
- ///
- /// The format options.
- ///
- public FormattingOptions options { get; set; }
- }
-
- public class DocumentFormattingParams
- {
- ///
- /// The document to format.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
-
- ///
- /// The format options.
- ///
- public FormattingOptions options { get; set; }
- }
-
- public class FormattingOptions
- {
- ///
- /// Size of a tab in spaces.
- ///
- public int TabSize { get; set; }
-
- ///
- /// Prefer spaces over tabs.
- ///
- public bool InsertSpaces { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/GetCommandRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/GetCommandRequest.cs
deleted file mode 100644
index df847dcbe..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/GetCommandRequest.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using System.Collections.Generic;
-using System.Management.Automation;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Describes the request to get the details for PowerShell Commands from the current session.
- ///
- public class GetCommandRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/getCommand");
- }
-
- ///
- /// Describes the message to get the details for a single PowerShell Command
- /// from the current session
- ///
- public class PSCommandMessage
- {
- public string Name { get; set; }
- public string ModuleName { get; set; }
- public string DefaultParameterSet { get; set; }
- public Dictionary Parameters { get; set; }
- public System.Collections.ObjectModel.ReadOnlyCollection ParameterSets { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/GetPSHostProcessesRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/GetPSHostProcessesRequest.cs
deleted file mode 100644
index 3c33a61d3..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/GetPSHostProcessesRequest.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class GetPSHostProcessesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/getPSHostProcesses");
- }
-
- public class GetPSHostProcessesResponse
- {
- public string ProcessName { get; set; }
-
- public int ProcessId { get; set; }
-
- public string AppDomainName { get; set; }
-
- public string MainWindowTitle { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/GetPSSARulesRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/GetPSSARulesRequest.cs
deleted file mode 100644
index 2199558c5..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/GetPSSARulesRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- class GetPSSARulesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/getPSSARules");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/GetRunspaceRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/GetRunspaceRequest.cs
deleted file mode 100644
index e151aa7f0..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/GetRunspaceRequest.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class GetRunspaceRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/getRunspace");
- }
-
- public class GetRunspaceResponse
- {
- public int Id { get; set; }
-
- public string Name { get; set; }
-
- public string Availability { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Hover.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Hover.cs
deleted file mode 100644
index 42c853254..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Hover.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class MarkedString
- {
- public string Language { get; set; }
-
- public string Value { get; set; }
- }
-
- public class Hover
- {
- public MarkedString[] Contents { get; set; }
-
- public Range Range { get; set; }
- }
-
- public class HoverRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/hover");
-
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Initialize.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Initialize.cs
deleted file mode 100644
index be73b74a0..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Initialize.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class InitializeRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("initialize");
- }
-
- public enum TraceType {
- Off,
- Messages,
- Verbose
- }
-
- public class InitializeParams {
- ///
- /// The process Id of the parent process that started the server
- ///
- public int ProcessId { get; set; }
-
- ///
- /// The root path of the workspace. It is null if no folder is open.
- ///
- /// This property has been deprecated in favor of RootUri.
- ///
- public string RootPath { get; set; }
-
- ///
- /// The root uri of the workspace. It is null if not folder is open. If both
- /// `RootUri` and `RootPath` are non-null, `RootUri` should be used.
- ///
- public string RootUri { get; set; }
-
- ///
- /// The capabilities provided by the client.
- ///
- public ClientCapabilities Capabilities { get; set; }
-
- ///
- /// User provided initialization options.
- ///
- /// This is defined as `any` type on the client side.
- ///
- public object InitializeOptions { get; set; }
-
- // TODO We need to verify if the deserializer will map the type defined in the client
- // to an enum.
- ///
- /// The initial trace setting. If omitted trace is disabled.
- ///
- public TraceType Trace { get; set; } = TraceType.Off;
- }
-
- public class InitializeResult
- {
- ///
- /// Gets or sets the capabilities provided by the language server.
- ///
- public ServerCapabilities Capabilities { get; set; }
- }
-
- public class InitializeError
- {
- ///
- /// Gets or sets a boolean indicating whether the client should retry
- /// sending the Initialize request after showing the error to the user.
- ///
- public bool Retry { get; set;}
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/InitializedNotification.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/InitializedNotification.cs
deleted file mode 100644
index 90836017f..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/InitializedNotification.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// The initialized notification is sent from the client to the server after the client received the result
- /// of the initialize request but before the client is sending any other request or notification to the server.
- /// The server can use the initialized notification for example to dynamically register capabilities.
- /// The initialized notification may only be sent once.
- ///
- public class InitializedNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("initialized");
- }
-
- ///
- /// Currently, the initialized message has no parameters.
- ///
- public class InitializedParams
- {
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/InstallModuleRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/InstallModuleRequest.cs
deleted file mode 100644
index 096d0e461..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/InstallModuleRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- class InstallModuleRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/installModule");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ProjectTemplate.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ProjectTemplate.cs
deleted file mode 100644
index 1b7441b28..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ProjectTemplate.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-using Microsoft.PowerShell.EditorServices.Templates;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class NewProjectFromTemplateRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/newProjectFromTemplate");
-
- public string DestinationPath { get; set; }
-
- public string TemplatePath { get; set; }
- }
-
- public class NewProjectFromTemplateResponse
- {
- public bool CreationSuccessful { get; set; }
- }
-
- public class GetProjectTemplatesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/getProjectTemplates");
-
- public bool IncludeInstalledModules { get; set; }
- }
-
- public class GetProjectTemplatesResponse
- {
- public bool NeedsModuleInstall { get; set; }
-
- public TemplateDetails[] Templates { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/References.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/References.cs
deleted file mode 100644
index 6965cb073..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/References.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class ReferencesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/references");
- }
-
- public class ReferencesParams : TextDocumentPositionParams
- {
- public ReferencesContext Context { get; set; }
- }
-
- public class ReferencesContext
- {
- public bool IncludeDeclaration { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/RunspaceChanged.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/RunspaceChanged.cs
deleted file mode 100644
index 3f2448097..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/RunspaceChanged.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Session;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class RunspaceChangedEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("powerShell/runspaceChanged");
- }
-
- public class RunspaceDetails
- {
- public PowerShellVersion PowerShellVersion { get; set; }
-
- public RunspaceLocation RunspaceType { get; set; }
-
- public string ConnectionString { get; set; }
-
- public RunspaceDetails()
- {
- }
-
- public RunspaceDetails(Session.RunspaceDetails eventArgs)
- {
- this.PowerShellVersion = new PowerShellVersion(eventArgs.PowerShellVersion);
- this.RunspaceType = eventArgs.Location;
- this.ConnectionString = eventArgs.ConnectionString;
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ScriptRegionRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ScriptRegionRequest.cs
deleted file mode 100644
index 79b36161e..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ScriptRegionRequest.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Class to encapsulate the request type.
- ///
- class ScriptRegionRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/getScriptRegion");
- }
-
- ///
- /// Class to encapsulate the request parameters.
- ///
- class ScriptRegionRequestParams
- {
- ///
- /// Path of the file for which the formatting region is requested.
- ///
- public string FileUri;
-
- ///
- /// Hint character.
- ///
- public string Character;
-
- ///
- /// 1-based line number of the character.
- ///
- public int Line;
-
- ///
- /// 1-based column number of the character.
- ///
- public int Column;
- }
-
- ///
- /// Class to encapsulate the result of ScriptRegionRequest.
- ///
- class ScriptRegionRequestResult
- {
- ///
- /// A region in the script that encapsulates the given character/position which is suitable
- /// for formatting
- ///
- public ScriptRegion scriptRegion;
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ServerCapabilities.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ServerCapabilities.cs
deleted file mode 100644
index e53ca4f6c..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ServerCapabilities.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class ServerCapabilities
- {
- public TextDocumentSyncKind? TextDocumentSync { get; set; }
-
- public bool? HoverProvider { get; set; }
-
- public CompletionOptions CompletionProvider { get; set; }
-
- public SignatureHelpOptions SignatureHelpProvider { get; set; }
-
- public bool? DefinitionProvider { get; set; }
-
- public bool? ReferencesProvider { get; set; }
-
- public bool? DocumentHighlightProvider { get; set; }
-
- public bool? DocumentSymbolProvider { get; set; }
-
- public bool? WorkspaceSymbolProvider { get; set; }
-
- public bool? CodeActionProvider { get; set; }
-
- public CodeLensOptions CodeLensProvider { get; set; }
-
- public bool? DocumentFormattingProvider { get; set; }
-
- public bool? DocumentRangeFormattingProvider { get; set; }
-
- public DocumentOnTypeFormattingOptions DocumentOnTypeFormattingProvider { get; set; }
-
- public bool? RenameProvider { get; set; }
-
- public DocumentLinkOptions DocumentLinkProvider { get; set; }
-
- public ExecuteCommandOptions ExecuteCommandProvider { get; set; }
-
- public object Experimental { get; set; }
-
- public bool FoldingRangeProvider { get; set; } = false;
- }
-
- ///
- /// Execute command options.
- ///
- public class ExecuteCommandOptions
- {
- ///
- /// The commands to be executed on the server.
- ///
- public string[] Commands { get; set; }
- }
-
- ///
- /// Document link options.
- ///
- public class DocumentLinkOptions
- {
- ///
- /// Document links have a resolve provider.
- ///
- public bool? ResolveProvider { get; set; }
- }
-
- ///
- /// Options that the server provides for OnTypeFormatting request.
- ///
- public class DocumentOnTypeFormattingOptions
- {
- ///
- /// A character on which formatting should be triggered.
- ///
- public string FirstTriggerCharacter { get; set; }
-
- ///
- /// More trigger characters.
- ///
- public string[] MoreTriggerCharacters { get; set; }
- }
-
- ///
- /// Defines the document synchronization strategies that a server may support.
- ///
- public enum TextDocumentSyncKind
- {
- ///
- /// Indicates that documents should not be synced at all.
- ///
- None = 0,
-
- ///
- /// Indicates that document changes are always sent with the full content.
- ///
- Full,
-
- ///
- /// Indicates that document changes are sent as incremental changes after
- /// the initial document content has been sent.
- ///
- Incremental
- }
-
- public class CompletionOptions
- {
- public bool? ResolveProvider { get; set; }
-
- public string[] TriggerCharacters { get; set; }
- }
-
- public class SignatureHelpOptions
- {
- public string[] TriggerCharacters { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ServerCommand.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ServerCommand.cs
deleted file mode 100644
index b299b5606..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ServerCommand.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class ServerCommand
- {
- ///
- /// Title of the command, like `save`.
- ///
- public string Title { get; set; }
-
- ///
- /// The identifier of the actual command handler.
- ///
- public string Command { get; set; }
-
- ///
- /// Arguments that the command handler should be
- /// invoked with.
- ///
- public JArray Arguments { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/SetPSSARulesRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/SetPSSARulesRequest.cs
deleted file mode 100644
index e3298cbd8..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/SetPSSARulesRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- class SetPSSARulesRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/setPSSARules");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/ShowHelpRequest.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/ShowHelpRequest.cs
deleted file mode 100644
index 0d73074d2..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/ShowHelpRequest.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
-
- public class ShowHelpRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("powerShell/showHelp");
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/Shutdown.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/Shutdown.cs
deleted file mode 100644
index f5fffce1c..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/Shutdown.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- ///
- /// Defines a message that is sent from the client to request
- /// that the server shut down.
- ///
- public class ShutdownRequest
- {
- public static readonly
- RequestType0 Type =
- RequestType0.Create("shutdown");
- }
-
- ///
- /// Defines an event that is sent from the client to notify that
- /// the client is exiting and the server should as well.
- ///
- public class ExitNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("exit");
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/SignatureHelp.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/SignatureHelp.cs
deleted file mode 100644
index e24fa6358..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/SignatureHelp.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class SignatureHelpRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/signatureHelp");
- }
-
- public class SignatureHelpRegistrationOptions : TextDocumentRegistrationOptions
- {
- // We duplicate the properties of SignatureHelpOptions class here because
- // we cannot derive from two classes. One way to get around this situation
- // is to use define SignatureHelpOptions as an interface instead of a class.
- public string[] TriggerCharacters { get; set; }
- }
-
- public class ParameterInformation
- {
- public string Label { get; set; }
-
- public string Documentation { get; set; }
- }
-
- public class SignatureInformation
- {
- public string Label { get; set; }
-
- public string Documentation { get; set; }
-
- public ParameterInformation[] Parameters { get; set; }
- }
-
- public class SignatureHelp
- {
- public SignatureInformation[] Signatures { get; set; }
-
- public int? ActiveSignature { get; set; }
-
- public int? ActiveParameter { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/StartDebuggerEvent.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/StartDebuggerEvent.cs
deleted file mode 100644
index 49adef43a..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/StartDebuggerEvent.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class StartDebuggerEvent
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("powerShell/startDebugger");
- }
-}
\ No newline at end of file
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/TextDocument.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/TextDocument.cs
deleted file mode 100644
index edd66f41a..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/TextDocument.cs
+++ /dev/null
@@ -1,313 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System.Diagnostics;
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
-
- ///
- /// An item to transfer a text document from the client to the server
- ///
- [DebuggerDisplay("TextDocumentItem = {Uri}:{LanguageId}:{Version}:{Text}")]
- public class TextDocumentItem
- {
- ///
- /// Gets or sets the URI which identifies the path of the
- /// text document.
- ///
- public string Uri { get; set; }
-
- ///
- /// The text document's language identifier.
- ///
- ///
- public string LanguageId { get; set; }
-
- ///
- /// The version number of this document, which will strictly increase after each change, including
- /// undo/redo.
- ///
- ///
- public int Version { get; set; }
-
- ///
- /// The content of the opened text document.
- ///
- ///
- public string Text { get; set; }
- }
-
- ///
- /// Defines a base parameter class for identifying a text document.
- ///
- [DebuggerDisplay("TextDocumentIdentifier = {Uri}")]
- public class TextDocumentIdentifier
- {
- ///
- /// Gets or sets the URI which identifies the path of the
- /// text document.
- ///
- public string Uri { get; set; }
- }
-
- ///
- /// An identifier to denote a specific version of a text document.
- ///
- public class VersionedTextDocumentIdentifier : TextDocumentIdentifier
- {
- ///
- /// The version number of this document.
- ///
- public int Version { get; set; }
- }
-
- ///
- /// A parameter literal used in requests to pass a text document and a position inside that document.
- ///
- public class TextDocumentPositionParams
- {
- ///
- /// The text document.
- ///
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
-
- ///
- /// The position inside the text document.
- ///
- ///
- public Position Position { get; set; }
- }
-
- public class DidOpenTextDocumentNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("textDocument/didOpen");
- }
-
- ///
- /// The parameters sent in an open text document notification
- ///
- public class DidOpenTextDocumentParams
- {
- ///
- /// The document that was opened.
- ///
- public TextDocumentItem TextDocument { get; set; }
- }
-
- ///
- /// General text document registration options.
- ///
- public class TextDocumentRegistrationOptions {
- ///
- /// A document selector to identify the scope of the registration. If set to null the document
- /// selector provided on the client side will be used.
- ///
- public DocumentFilter[] DocumentSelector { get; set; }
- }
-
- ///
- /// A document filter denotes a document by different properties like the language, the scheme
- /// of its resource, or a glob-pattern that is applied to the path.
- ///
- public class DocumentFilter
- {
- ///
- /// A language id, like `powershell`
- ///
- public string Language { get; set; }
-
- ///
- /// A Uri, like `file` or `untitled`
- ///
- public string Scheme { get; set; }
-
- ///
- /// A glob pattern, like `*.{ps1,psd1}`
- ///
- public string Pattern { get; set; }
- }
-
- public class DidCloseTextDocumentNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("textDocument/didClose");
- }
-
- ///
- /// The parameters sent in a close text document notification.
- ///
- public class DidCloseTextDocumentParams
- {
- ///
- /// The document that was closed.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
- }
-
- public class DidSaveTextDocumentNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("textDocument/didSave");
- }
-
- ///
- /// Save options.
- ///
- public class SaveOptions {
- ///
- /// The client is supposed to include the content on save.
- ///
- public bool? IncludeText { get; set; }
- }
-
- public class TextDocumentSaveRegistrationOptions : TextDocumentRegistrationOptions
- {
- // We cannot inherit from two base classes (SaveOptions and TextDocumentRegistrationOptions)
- // simultaneously, hence we repeat this IncludeText flag here.
- ///
- /// The client is supposed to include the content on save.
- ///
- public bool? IncludeText { get; set; }
- }
-
- ///
- /// The parameters sent in a save text document notification.
- ///
- public class DidSaveTextDocumentParams
- {
- ///
- /// The document that was saved.
- ///
- public VersionedTextDocumentIdentifier TextDocument { get; set; }
-
- ///
- /// Optional content when saved. Depends on the includeText value when the save notification was
- /// included.
- ///
- public string Text { get; set; }
- }
-
- public class DidChangeTextDocumentNotification
- {
- public static readonly
- NotificationType Type =
- NotificationType.Create("textDocument/didChange");
- }
-
- ///
- /// Describe options to be used when registered for text document change events.
- ///
- public class TextDocumentChangeRegistrationOptions : TextDocumentRegistrationOptions
- {
- ///
- /// How documents are synced to the server.
- ///
- public TextDocumentSyncKind SyncKind { get; set; }
- }
-
- ///
- /// The change text document notification's paramters.
- ///
- public class DidChangeTextDocumentParams
- {
- ///
- /// The document that did change. The version number points to the version after
- /// all provided content changes have been applied.
- ///
- public VersionedTextDocumentIdentifier TextDocument;
-
- ///
- /// Gets or sets the list of changes to the document content.
- ///
- public TextDocumentChangeEvent[] ContentChanges { get; set; }
- }
-
- public class TextDocumentChangeEvent
- {
- ///
- /// Gets or sets the Range where the document was changed. Will
- /// be null if the server's TextDocumentSyncKind is Full.
- ///
- public Range Range { get; set; }
-
- ///
- /// Gets or sets the length of the Range being replaced in the
- /// document. Will be null if the server's TextDocumentSyncKind is
- /// Full.
- ///
- public int? RangeLength { get; set; }
-
- ///
- /// Gets or sets the new text of the document.
- ///
- public string Text { get; set; }
- }
-
- [DebuggerDisplay("Position = {Line}:{Character}")]
- public class Position
- {
- ///
- /// Gets or sets the zero-based line number.
- ///
- public int Line { get; set; }
-
- ///
- /// Gets or sets the zero-based column number.
- ///
- public int Character { get; set; }
- }
-
- [DebuggerDisplay("Start = {Start.Line}:{Start.Character}, End = {End.Line}:{End.Character}")]
- public class Range
- {
- ///
- /// Gets or sets the starting position of the range.
- ///
- public Position Start { get; set; }
-
- ///
- /// Gets or sets the ending position of the range.
- ///
- public Position End { get; set; }
- }
-
- [DebuggerDisplay("Range = {Range.Start.Line}:{Range.Start.Character} - {Range.End.Line}:{Range.End.Character}, Uri = {Uri}")]
- public class Location
- {
- ///
- /// Gets or sets the URI indicating the file in which the location refers.
- ///
- public string Uri { get; set; }
-
- ///
- /// Gets or sets the Range indicating the range in which location refers.
- ///
- public Range Range { get; set; }
- }
-
- public enum FileChangeType
- {
- Created = 1,
-
- Changed,
-
- Deleted
- }
-
- public class FileEvent
- {
- public string Uri { get; set; }
-
- public FileChangeType Type { get; set; }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/TextDocumentClientCapabilities.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/TextDocumentClientCapabilities.cs
deleted file mode 100644
index c620ad056..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/TextDocumentClientCapabilities.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class TextDocumentClientCapabilities
- {
- ///
- /// Synchronization capabilities the client supports.
- ///
- public SynchronizationCapabilities Synchronization { get; set; }
-
- ///
- /// Capabilities specific to `textDocument/completion`.
- ///
- public CompletionCapabilities Completion { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/hover`.
- ///
- public DynamicRegistrationCapability Hover { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/signatureHelp`.
- ///
- public DynamicRegistrationCapability SignatureHelp { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/references`.
- ///
- public DynamicRegistrationCapability References { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/documentHighlight`.
- ///
- public DynamicRegistrationCapability DocumentHighlight { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/documentSymbol`.
- ///
- public DynamicRegistrationCapability DocumentSymbol { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/formatting`.
- ///
- public DynamicRegistrationCapability Formatting { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/rangeFormatting`.
- ///
- public DynamicRegistrationCapability RangeFormatting { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/onTypeFormatting`.
- ///
- public DynamicRegistrationCapability OnTypeFormatting { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/definition`.
- ///
- public DynamicRegistrationCapability Definition { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/codeAction`.
- ///
- public DynamicRegistrationCapability CodeAction { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/codeLens`.
- ///
- public DynamicRegistrationCapability CodeLens { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/documentLink`.
- ///
- public DynamicRegistrationCapability DocumentLink { get; set; }
-
- ///
- /// Capabilities specific to the `textDocument/rename`.
- ///
- public DynamicRegistrationCapability Rename { get; set; }
- }
-
- ///
- /// Class to represent capabilities specific to `textDocument/completion`.
- ///
- public class CompletionCapabilities : DynamicRegistrationCapability
- {
- ///
- /// The client supports the following `CompletionItem` specific capabilities.
- ///
- ///
- public CompletionItemCapabilities CompletionItem { get; set; }
- }
-
- ///
- /// Class to represent capabilities specific to `CompletionItem`.
- ///
- public class CompletionItemCapabilities
- {
- ///
- /// Client supports snippets as insert text.
- ///
- /// A snippet can define tab stops and placeholders with `$1`, `$2`
- /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to
- /// the end of the snippet. Placeholders with equal identifiers are linked,
- /// that is typing in one will update others too.
- ///
- public bool? SnippetSupport { get; set; }
- }
-
- ///
- /// Class to represent synchronization capabilities the client supports.
- ///
- public class SynchronizationCapabilities : DynamicRegistrationCapability
- {
- ///
- /// The client supports sending will save notifications.
- ///
- public bool? WillSave { get; set; }
-
- ///
- /// The client supports sending a will save request and waits for a response
- /// providing text edits which will be applied to the document before it is save.
- ///
- public bool? WillSaveWaitUntil { get; set; }
-
- ///
- /// The client supports did save notifications.
- ///
- public bool? DidSave { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceClientCapabilities.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceClientCapabilities.cs
deleted file mode 100644
index 3e781a217..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceClientCapabilities.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public class WorkspaceClientCapabilities
- {
- ///
- /// The client supports applying batch edits to the workspace by
- /// by supporting the request `workspace/applyEdit'
- /// ///
- bool? ApplyEdit { get; set; }
-
- ///
- /// Capabilities specific to `WorkspaceEdit`.
- ///
- public WorkspaceEditCapabilities WorkspaceEdit { get; set; }
-
- ///
- /// Capabilities specific to the `workspace/didChangeConfiguration` notification.
- ///
- public DynamicRegistrationCapability DidChangeConfiguration { get; set; }
-
- ///
- /// Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
- ///
- public DynamicRegistrationCapability DidChangeWatchedFiles { get; set; }
-
- ///
- /// Capabilities specific to the `workspace/symbol` request.
- ///
- public DynamicRegistrationCapability Symbol { get; set; }
-
- ///
- /// Capabilities specific to the `workspace/executeCommand` request.
- ///
- public DynamicRegistrationCapability ExecuteCommand { get; set; }
- }
-
- ///
- /// Class to represent capabilities specific to `WorkspaceEdit`.
- ///
- public class WorkspaceEditCapabilities
- {
- ///
- /// The client supports versioned document changes in `WorkspaceEdit`
- ///
- bool? DocumentChanges { get; set; }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceSymbols.cs b/src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceSymbols.cs
deleted file mode 100644
index 97e990345..000000000
--- a/src/PowerShellEditorServices.Protocol/LanguageServer/WorkspaceSymbols.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
-{
- public enum SymbolKind
- {
- File = 1,
- Module = 2,
- Namespace = 3,
- Package = 4,
- Class = 5,
- Method = 6,
- Property = 7,
- Field = 8,
- Constructor = 9,
- Enum = 10,
- Interface = 11,
- Function = 12,
- Variable = 13,
- Constant = 14,
- String = 15,
- Number = 16,
- Boolean = 17,
- Array = 18,
- }
-
- public class SymbolInformation
- {
- public string Name { get; set; }
-
- public SymbolKind Kind { get; set; }
-
- public Location Location { get; set; }
-
- public string ContainerName { get; set;}
- }
-
- public class DocumentSymbolRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("textDocument/documentSymbol");
- }
-
- ///
- /// Parameters for a DocumentSymbolRequest
- ///
- public class DocumentSymbolParams
- {
- ///
- /// The text document.
- ///
- public TextDocumentIdentifier TextDocument { get; set; }
- }
-
- public class WorkspaceSymbolRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("workspace/symbol");
- }
-
- public class WorkspaceSymbolParams
- {
- public string Query { get; set;}
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/MessageProtocol/AbstractMessageType.cs b/src/PowerShellEditorServices.Protocol/MessageProtocol/AbstractMessageType.cs
deleted file mode 100644
index 1b2fc37f9..000000000
--- a/src/PowerShellEditorServices.Protocol/MessageProtocol/AbstractMessageType.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
-{
- ///
- /// Defines an event type with a particular method name.
- ///
- /// The parameter type for this event.
- public class AbstractMessageType
- {
- private string _method;
- private int _numberOfParams;
-
- ///
- /// Gets the method name for the event type.
- ///
- public string Method { get { return _method; } }
-
- ///
- /// Gets the number of parameters.
- ///
- public int NumberOfParams { get; }
-
- public AbstractMessageType(string method, int numberOfParams)
- {
- _method = method;
- _numberOfParams = numberOfParams;
- }
- }
-}
-
-
diff --git a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/ChannelBase.cs b/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/ChannelBase.cs
deleted file mode 100644
index ea4922938..000000000
--- a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/ChannelBase.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
-{
- ///
- /// Defines a base implementation for servers and their clients over a
- /// single kind of communication channel.
- ///
- public abstract class ChannelBase
- {
- ///
- /// Gets the MessageReader for reading messages from the channel.
- ///
- public MessageReader MessageReader { get; protected set; }
-
- ///
- /// Gets the MessageWriter for writing messages to the channel.
- ///
- public MessageWriter MessageWriter { get; protected set; }
-
- ///
- /// Starts the channel and initializes the MessageDispatcher.
- ///
- /// The type of message protocol used by the channel.
- public void Start(MessageProtocolType messageProtocolType)
- {
- IMessageSerializer messageSerializer = null;
- if (messageProtocolType == MessageProtocolType.LanguageServer)
- {
- messageSerializer = new JsonRpcMessageSerializer();
- }
- else
- {
- messageSerializer = new V8MessageSerializer();
- }
-
- this.Initialize(messageSerializer);
- }
-
- ///
- /// Stops the channel.
- ///
- public void Stop()
- {
- this.Shutdown();
- }
-
- ///
- /// A method to be implemented by subclasses to handle the
- /// actual initialization of the channel and the creation and
- /// assignment of the MessageReader and MessageWriter properties.
- ///
- /// The IMessageSerializer to use for message serialization.
- protected abstract void Initialize(IMessageSerializer messageSerializer);
-
- ///
- /// A method to be implemented by subclasses to handle shutdown
- /// of the channel once Stop is called.
- ///
- protected abstract void Shutdown();
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeClientChannel.cs b/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeClientChannel.cs
deleted file mode 100644
index 1d3bd8a7d..000000000
--- a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeClientChannel.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System;
-using System.IO.Pipes;
-using System.Runtime.InteropServices;
-using System.Threading.Tasks;
-using Microsoft.PowerShell.EditorServices.Utility;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
-{
- public class NamedPipeClientChannel : ChannelBase
- {
- private ILogger logger;
- private NamedPipeClientStream pipeClient;
-
- // This int will be casted to a PipeOptions enum that only exists in .NET Core 2.1 and up which is why it's not available to us in .NET Standard.
- private const int CurrentUserOnly = 536870912;
-
- private const string NAMED_PIPE_UNIX_PREFIX = "CoreFxPipe_";
-
- public NamedPipeClientChannel(
- NamedPipeClientStream pipeClient,
- ILogger logger)
- {
- this.pipeClient = pipeClient;
- this.logger = logger;
- }
-
- protected override void Initialize(IMessageSerializer messageSerializer)
- {
- this.MessageReader =
- new MessageReader(
- this.pipeClient,
- messageSerializer,
- this.logger);
-
- this.MessageWriter =
- new MessageWriter(
- this.pipeClient,
- messageSerializer,
- this.logger);
- }
-
- protected override void Shutdown()
- {
- if (this.pipeClient != null)
- {
- this.pipeClient.Dispose();
- }
- }
-
- public static async Task ConnectAsync(
- string pipeFile,
- MessageProtocolType messageProtocolType,
- ILogger logger)
- {
- string pipeName = System.IO.Path.GetFileName(pipeFile);
-
- var options = PipeOptions.Asynchronous;
- // on macOS and Linux, the named pipe name is prefixed by .NET Core
- if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- pipeName = pipeFile.Split(new [] {NAMED_PIPE_UNIX_PREFIX}, StringSplitOptions.None)[1];
- options |= (PipeOptions)CurrentUserOnly;
- }
-
- var pipeClient =
- new NamedPipeClientStream(
- ".",
- pipeName,
- PipeDirection.InOut,
- options);
-
- await pipeClient.ConnectAsync();
- var clientChannel = new NamedPipeClientChannel(pipeClient, logger);
- clientChannel.Start(messageProtocolType);
-
- return clientChannel;
- }
- }
-}
diff --git a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeServerChannel.cs b/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeServerChannel.cs
deleted file mode 100644
index 870640c49..000000000
--- a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeServerChannel.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.PowerShell.EditorServices.Utility;
-using System.IO.Pipes;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
-{
- public class NamedPipeServerChannel : ChannelBase
- {
- private ILogger logger;
- private NamedPipeServerStream inOutPipeServer;
- private NamedPipeServerStream outPipeServer;
-
- public NamedPipeServerChannel(
- NamedPipeServerStream inOutPipeServer,
- ILogger logger)
- {
- this.inOutPipeServer = inOutPipeServer;
- this.logger = logger;
- }
- public NamedPipeServerChannel(
- NamedPipeServerStream inOutPipeServer,
- NamedPipeServerStream outPipeServer,
- ILogger logger)
- {
- this.inOutPipeServer = inOutPipeServer;
- this.outPipeServer = outPipeServer;
- this.logger = logger;
- }
-
- protected override void Initialize(IMessageSerializer messageSerializer)
- {
- this.MessageReader =
- new MessageReader(
- this.inOutPipeServer,
- messageSerializer,
- this.logger);
-
- this.MessageWriter =
- new MessageWriter(
- this.outPipeServer ?? this.inOutPipeServer,
- messageSerializer,
- this.logger);
- }
-
- protected override void Shutdown()
- {
- // The server listener will take care of the pipe server
- this.inOutPipeServer = null;
- this.outPipeServer = null;
- }
- }
-}
-
diff --git a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/ServerListenerBase.cs b/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/ServerListenerBase.cs
deleted file mode 100644
index 433f6aabb..000000000
--- a/src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/ServerListenerBase.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using System;
-using System.Threading.Tasks;
-
-namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
-{
- public abstract class ServerListenerBase