Skip to content

Commit 7ff5083

Browse files
update namespaces
1 parent ca7045a commit 7ff5083

File tree

10 files changed

+70
-70
lines changed

10 files changed

+70
-70
lines changed

NuGet.Config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<add key="disableSourceControlIntegration" value="true" />
55
</solution>
66
<packageSources>
7-
<add key="local" value="/Users/tyler/Code/CSharp/csharp-language-server-protocol/artifacts/nuget" />
7+
<add key="local" value="/Users/tyleonha/Code/CSharp/csharp-language-server-protocol/artifacts/nuget" />
88
<add key="omnisharp" value="https://www.myget.org/F/omnisharp/api/v3/index.json" protocolVersion="3" />
99
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
1010
</packageSources>

docs/api/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ the PowerShell debugger.
2020
Use the @Microsoft.PowerShell.EditorServices.Console.ConsoleService to provide interactive
2121
console support in the user's editor.
2222

23-
Use the @Microsoft.PowerShell.EditorServices.Extensions.ExtensionService to allow
23+
Use the @Microsoft.PowerShell.EditorServices.Engine.Services.ExtensionService to allow
2424
the user to extend the host editor with new capabilities using PowerShell code.
2525

2626
The core of all the services is the @Microsoft.PowerShell.EditorServices.PowerShellContext
2727
class. This class manages a session's runspace and handles script and command
28-
execution no matter what state the runspace is in.
28+
execution no matter what state the runspace is in.

docs/guide/extensions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ uses PowerShell Editor Services.
99
### Introducing `$psEditor`
1010

1111
The entry point for the PowerShell Editor Services extensibility model is the `$psEditor`
12-
object of the type @Microsoft.PowerShell.EditorServices.Extensions.EditorObject. For
12+
object of the type @Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorObject. For
1313
those familiar with the PowerShell ISE's `$psISE` object, the `$psEditor` object is very
1414
similar. The primary difference is that this model has been generalized to work against
1515
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
1919
> please file an issue on our GitHub page.
2020
2121
This object gives access to all of the high-level services in the current
22-
editing session. For example, the @Microsoft.PowerShell.EditorServices.Extensions.EditorObject.Workspace
22+
editing session. For example, the @Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorObject.Workspace
2323
property gives access to the editor's workspace, allowing you to create or open files
2424
in the editor.
2525

@@ -79,17 +79,17 @@ Register-EditorCommand `
7979
-ScriptBlock { Write-Output "My command's script block was invoked!" }
8080
```
8181

82-
### The @Microsoft.PowerShell.EditorServices.Extensions.EditorContext parameter
82+
### The @Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext parameter
8383

8484
Your function, cmdlet, or ScriptBlock can optionally accept a single parameter
85-
of type @Microsoft.PowerShell.EditorServices.Extensions.EditorContext which provides
85+
of type @Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext which provides
8686
information about the state of the host editor at the time your command was
8787
invoked. With this object you can easily perform operations like manipulatin the
8888
state of the user's active editor buffer or changing the current selection.
8989

9090
The usual convention is that a `$context` parameter is added to your editor
9191
command's function. For now it is recommended that you fully specify the
92-
type of the @Microsoft.PowerShell.EditorServices.Extensions.EditorContext object
92+
type of the @Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext object
9393
so that you get full IntelliSense on your context parameter.
9494

9595
Here is an example of using the `$context` parameter:
@@ -99,7 +99,7 @@ Register-EditorCommand `
9999
-Name "MyModule.MyEditorCommandWithContext" `
100100
-DisplayName "My command with context usage" `
101101
-ScriptBlock {
102-
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
102+
param([Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext]$context)
103103
Write-Output "The user's cursor is on line $($context.CursorPosition.Line)!"
104104
}
105105
```
@@ -165,4 +165,4 @@ in that editor starts up.
165165
> NOTE: In the future we plan to provide an easy way for the user to opt-in
166166
> to the automatic loading of any editor command modules that they've installed
167167
> from the PowerShell Gallery. If this interests you, please let us know on
168-
> [this GitHub issue](https://github.com/PowerShell/PowerShellEditorServices/issues/215).
168+
> [this GitHub issue](https://github.com/PowerShell/PowerShellEditorServices/issues/215).

module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.VSCode.dll"
77

8-
if ($psEditor -is [Microsoft.PowerShell.EditorServices.Extensions.EditorObject]) {
8+
if ($psEditor -is [Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorObject]) {
99
[Microsoft.PowerShell.EditorServices.VSCode.ComponentRegistration]::Register($psEditor.Components)
1010
}
1111
else {

module/PowerShellEditorServices.VSCode/Public/HtmlContentView/New-VSCodeHtmlContentView.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function New-VSCodeHtmlContentView {
4141
)
4242

4343
process {
44-
if ($psEditor -is [Microsoft.PowerShell.EditorServices.Extensions.EditorObject]) {
44+
if ($psEditor -is [Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorObject]) {
4545
$viewFeature = $psEditor.Components.Get([Microsoft.PowerShell.EditorServices.VSCode.CustomViews.IHtmlContentViews])
4646
$view = $viewFeature.CreateHtmlContentViewAsync($Title).Result
4747

module/PowerShellEditorServices/Commands/Private/BuiltInCommands.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Register-EditorCommand `
33
-DisplayName 'Open Editor Profile' `
44
-SuppressOutput `
55
-ScriptBlock {
6-
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
6+
param([Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext]$context)
77
If (!(Test-Path -Path $Profile)) { New-Item -Path $Profile -ItemType File }
88
$psEditor.Workspace.OpenFile($Profile)
99
}
@@ -13,18 +13,18 @@ Register-EditorCommand `
1313
-DisplayName 'Open Profile from List (Current User)' `
1414
-SuppressOutput `
1515
-ScriptBlock {
16-
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContext]$context)
17-
18-
$Current = Split-Path -Path $profile -Leaf
16+
param([Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext]$context)
17+
18+
$Current = Split-Path -Path $profile -Leaf
1919
$List = @($Current,'Microsoft.VSCode_profile.ps1','Microsoft.PowerShell_profile.ps1','Microsoft.PowerShellISE_profile.ps1','Profile.ps1') | Select-Object -Unique
2020
$Choices = [System.Management.Automation.Host.ChoiceDescription[]] @($List)
2121
$Selection = $host.ui.PromptForChoice('Please Select a Profile', '(Current User)', $choices,'0')
2222
$Name = $List[$Selection]
23-
23+
2424
$ProfileDir = Split-Path $Profile -Parent
2525
$ProfileName = Join-Path -Path $ProfileDir -ChildPath $Name
26-
26+
2727
If (!(Test-Path -Path $ProfileName)) { New-Item -Path $ProfileName -ItemType File }
28-
28+
2929
$psEditor.Workspace.OpenFile($ProfileName)
30-
}
30+
}

module/PowerShellEditorServices/Commands/Public/CmdletInterface.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function Register-EditorCommand {
4747
$commandArgs += $Function
4848
}
4949

50-
$editorCommand = New-Object Microsoft.PowerShell.EditorServices.Extensions.EditorCommand -ArgumentList $commandArgs
50+
$editorCommand = New-Object Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommand -ArgumentList $commandArgs
5151
if ($psEditor.RegisterCommand($editorCommand))
5252
{
5353
Write-Verbose "Registered new command '$Name'"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Import-EditorCommand {
77
<#
88
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
99
#>
10-
[OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand])]
10+
[OutputType([Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommand])]
1111
[CmdletBinding(DefaultParameterSetName='ByCommand')]
1212
param(
1313
[Parameter(Position=0,
@@ -75,7 +75,7 @@ function Import-EditorCommand {
7575
$commands = $Command | Get-Command -ErrorAction SilentlyContinue
7676
}
7777
}
78-
$attributeType = [Microsoft.PowerShell.EditorServices.Extensions.EditorCommandAttribute]
78+
$attributeType = [Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommandAttribute]
7979
foreach ($aCommand in $commands) {
8080
# Get the attribute from our command to get name info.
8181
$details = $aCommand.ScriptBlock.Attributes | Where-Object TypeId -eq $attributeType
@@ -99,7 +99,7 @@ function Import-EditorCommand {
9999
}
100100
# Check for a context parameter.
101101
$contextParameter = $aCommand.Parameters.Values |
102-
Where-Object ParameterType -eq ([Microsoft.PowerShell.EditorServices.Extensions.EditorContext])
102+
Where-Object ParameterType -eq ([Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorContext])
103103

104104
# If one is found then add a named argument. Otherwise call the command directly.
105105
if ($contextParameter) {
@@ -109,7 +109,7 @@ function Import-EditorCommand {
109109
$scriptBlock = [scriptblock]::Create($aCommand.Name)
110110
}
111111

112-
$editorCommand = New-Object Microsoft.PowerShell.EditorServices.Extensions.EditorCommand @(
112+
$editorCommand = New-Object Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommand @(
113113
<# commandName: #> $details.Name,
114114
<# displayName: #> $details.DisplayName,
115115
<# suppressOutput: #> $details.SuppressOutput,

module/docs/Import-EditorCommand.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The Import-EditorCommand function will search the specified module for functions
3030

3131
Alternatively, you can specify command info objects (like those from the Get-Command cmdlet) to be processed directly.
3232

33-
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'.
33+
To tag a command as an editor command, attach the attribute 'Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommandAttribute' to the function like you would with 'CmdletBindingAttribute'. The attribute accepts the named parameters 'Name', 'DisplayName', and 'SuppressOutput'.
3434

3535
## EXAMPLES
3636

@@ -55,7 +55,7 @@ Registers all editor commands that contain "Editor" in the name and return all s
5555
```powershell
5656
function Invoke-MyEditorCommand {
5757
[CmdletBinding()]
58-
[Microsoft.PowerShell.EditorServices.Extensions.EditorCommand(DisplayName='My Command', SuppressOutput)]
58+
[Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommand(DisplayName='My Command', SuppressOutput)]
5959
param()
6060
end {
6161
ConvertTo-ScriptExtent -Offset 0 | Set-ScriptExtent -Text 'My Command!'
@@ -145,7 +145,7 @@ You can pass commands to register as editor commands.
145145
146146
## OUTPUTS
147147
148-
### Microsoft.PowerShell.EditorServices.Extensions.EditorCommand
148+
### Microsoft.PowerShell.EditorServices.Engine.Services.PowerShellContext.EditorCommand
149149
150150
If the "PassThru" parameter is specified editor commands that were successfully registered
151151
will be returned. This function does not output to the pipeline otherwise.

src/PowerShellEditorServices.Engine/Hosting/EditorServicesHost.cs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -291,48 +291,48 @@ public void StartDebugService(
291291
ProfilePaths profilePaths,
292292
bool useExistingSession)
293293
{
294-
while (!System.Diagnostics.Debugger.IsAttached)
295-
{
296-
System.Console.WriteLine($"{Process.GetCurrentProcess().Id}");
297-
Thread.Sleep(2000);
298-
}
299-
300-
_logger.LogInformation($"Debug NamedPipe: {config.InOutPipeName}\nDebug OutPipe: {config.OutPipeName}");
301-
302-
switch (config.TransportType)
303-
{
304-
case EditorServiceTransportType.NamedPipe:
305-
NamedPipeServerStream inNamedPipe = CreateNamedPipe(
306-
config.InOutPipeName ?? config.InPipeName,
307-
config.OutPipeName,
308-
out NamedPipeServerStream outNamedPipe);
309-
310-
_debugServer = new PsesDebugServer(
311-
_factory,
312-
inNamedPipe,
313-
outNamedPipe ?? inNamedPipe);
314-
315-
Task[] tasks = outNamedPipe != null
316-
? new[] { inNamedPipe.WaitForConnectionAsync(), outNamedPipe.WaitForConnectionAsync() }
317-
: new[] { inNamedPipe.WaitForConnectionAsync() };
318-
Task.WhenAll(tasks)
319-
.ContinueWith(async task => {
320-
_logger.LogInformation("Starting debug server");
321-
await _debugServer.StartAsync(_languageServer.LanguageServer.Services);
322-
_logger.LogInformation(
323-
$"Debug service started, type = {config.TransportType}, endpoint = {config.Endpoint}");
324-
});
325-
break;
326-
327-
default:
328-
throw new NotSupportedException("not supported");
329-
}
330-
331-
_debugServer.SessionEnded += (sender, eventArgs) =>
332-
{
333-
_debugServer.Dispose();
334-
StartDebugService(config, profilePaths, useExistingSession);
335-
};
294+
//while (!System.Diagnostics.Debugger.IsAttached)
295+
//{
296+
// System.Console.WriteLine($"{Process.GetCurrentProcess().Id}");
297+
// Thread.Sleep(2000);
298+
//}
299+
300+
//_logger.LogInformation($"Debug NamedPipe: {config.InOutPipeName}\nDebug OutPipe: {config.OutPipeName}");
301+
302+
//switch (config.TransportType)
303+
//{
304+
// case EditorServiceTransportType.NamedPipe:
305+
// NamedPipeServerStream inNamedPipe = CreateNamedPipe(
306+
// config.InOutPipeName ?? config.InPipeName,
307+
// config.OutPipeName,
308+
// out NamedPipeServerStream outNamedPipe);
309+
310+
// _debugServer = new PsesDebugServer(
311+
// _factory,
312+
// inNamedPipe,
313+
// outNamedPipe ?? inNamedPipe);
314+
315+
// Task[] tasks = outNamedPipe != null
316+
// ? new[] { inNamedPipe.WaitForConnectionAsync(), outNamedPipe.WaitForConnectionAsync() }
317+
// : new[] { inNamedPipe.WaitForConnectionAsync() };
318+
// Task.WhenAll(tasks)
319+
// .ContinueWith(async task => {
320+
// _logger.LogInformation("Starting debug server");
321+
// await _debugServer.StartAsync(_languageServer.LanguageServer.Services);
322+
// _logger.LogInformation(
323+
// $"Debug service started, type = {config.TransportType}, endpoint = {config.Endpoint}");
324+
// });
325+
// break;
326+
327+
// default:
328+
// throw new NotSupportedException("not supported");
329+
//}
330+
331+
//_debugServer.SessionEnded += (sender, eventArgs) =>
332+
//{
333+
// _debugServer.Dispose();
334+
// StartDebugService(config, profilePaths, useExistingSession);
335+
//};
336336
}
337337

338338
/// <summary>

0 commit comments

Comments
 (0)