Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ public static Collection<PSObject> InvokeOnRunspace(PSCommand command, Runspace
[string] $PSEditFunction
)

Register-EngineEvent -SourceIdentifier PSISERemoteSessionOpenFile -Forward
Register-EngineEvent -SourceIdentifier PSISERemoteSessionOpenFile -Forward -SupportEvent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What prompted this change? Is there a bug or is this just code clean up? The ISE doesn't use PSCore but I believe the VSCode PowerShell extension does. So if this is code clean up then it should include renaming these helper functions to make it clear it is a general remote file open mechanism and not specific to ISE.

I seem to remember there was an issue using -SupportEvent switch ... but I may be mis-remembering. But you should do some remote debugging tests with VSCode to ensure nothing is broken.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just code cleanup. I found the forwarding events PSInternalRemoteDebuggerStopEvent and PSInternalRemoteDebuggerBreakpointUpdatedEvent are both supporting events. Get-EventSubscriber doesn't return them but return PSISERemoteSessionOpenFile, so I submitted this PR to make them consistent.

I will sync with Tyler to verify PSEdit with VS code.


if ((Test-Path -Path 'function:\global:PSEdit') -eq $false)
{
Expand All @@ -960,7 +960,7 @@ public static Collection<PSObject> InvokeOnRunspace(PSCommand command, Runspace
Remove-Item -Path 'function:\global:PSEdit' -Force
}

Unregister-Event -SourceIdentifier PSISERemoteSessionOpenFile -ErrorAction Ignore
Unregister-Event -SourceIdentifier PSISERemoteSessionOpenFile -Force -ErrorAction Ignore
";

/// <summary>
Expand Down