File tree 2 files changed +44
-0
lines changed
src/PowerShellEditorServices.Protocol
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // Copyright (c) Microsoft. All rights reserved.
3
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
4
+ //
5
+
6
+ using Microsoft . PowerShell . EditorServices . Protocol . MessageProtocol ;
7
+
8
+ namespace Microsoft . PowerShell . EditorServices . Protocol . DebugAdapter
9
+ {
10
+ public class BreakpointEvent
11
+ {
12
+ public static readonly
13
+ EventType < BreakpointEvent > Type =
14
+ EventType < BreakpointEvent > . Create ( "breakpoint" ) ;
15
+
16
+ public string Reason { get ; set ; }
17
+
18
+ public Breakpoint Breakpoint { get ; set ; }
19
+ }
20
+ }
Original file line number Diff line number Diff line change @@ -842,6 +842,7 @@ await this.SendEvent(
842
842
private void RegisterEventHandlers ( )
843
843
{
844
844
this . editorSession . PowerShellContext . RunspaceChanged += this . powerShellContext_RunspaceChanged ;
845
+ this . editorSession . DebugService . BreakpointUpdated += DebugService_BreakpointUpdated ;
845
846
this . editorSession . DebugService . DebuggerStopped += this . DebugService_DebuggerStopped ;
846
847
this . editorSession . PowerShellContext . DebuggerResumed += this . powerShellContext_DebuggerResumed ;
847
848
@@ -855,6 +856,7 @@ private void RegisterEventHandlers()
855
856
private void UnregisterEventHandlers ( )
856
857
{
857
858
this . editorSession . PowerShellContext . RunspaceChanged -= this . powerShellContext_RunspaceChanged ;
859
+ this . editorSession . DebugService . BreakpointUpdated -= DebugService_BreakpointUpdated ;
858
860
this . editorSession . DebugService . DebuggerStopped -= this . DebugService_DebuggerStopped ;
859
861
this . editorSession . PowerShellContext . DebuggerResumed -= this . powerShellContext_DebuggerResumed ;
860
862
@@ -947,6 +949,28 @@ await this.SendEvent(
947
949
} ) ;
948
950
}
949
951
952
+ private async void DebugService_BreakpointUpdated ( object sender , BreakpointUpdatedEventArgs e )
953
+ {
954
+ string reason =
955
+ e . UpdateType == BreakpointUpdateType . Set
956
+ ? "new" : "changed" ;
957
+
958
+ var breakpoint = Protocol . DebugAdapter . Breakpoint . Create (
959
+ BreakpointDetails . Create ( e . Breakpoint ) ) ;
960
+
961
+ breakpoint . Verified =
962
+ ! ( e . UpdateType == BreakpointUpdateType . Removed ||
963
+ e . UpdateType == BreakpointUpdateType . Disabled ) ;
964
+
965
+ await this . SendEvent (
966
+ BreakpointEvent . Type ,
967
+ new BreakpointEvent
968
+ {
969
+ Reason = reason ,
970
+ Breakpoint = breakpoint
971
+ } ) ;
972
+ }
973
+
950
974
#endregion
951
975
}
952
976
}
You can’t perform that action at this time.
0 commit comments