@@ -295,6 +295,11 @@ await this.editorSession.PowerShellContext.ExecuteScriptString(
295
295
"" , false , true ) ;
296
296
}
297
297
298
+ if ( this . editorSession . ConsoleService . EnableConsoleRepl )
299
+ {
300
+ await this . WriteUseIntegratedConsoleMessage ( ) ;
301
+ }
302
+
298
303
// Send the InitializedEvent so that the debugger will continue
299
304
// sending configuration requests
300
305
await this . SendEvent (
@@ -743,23 +748,30 @@ protected async Task HandleEvaluateRequest(
743
748
744
749
if ( isFromRepl )
745
750
{
746
- // Check for special commands
747
- if ( string . Equals ( "!ctrlc" , evaluateParams . Expression , StringComparison . CurrentCultureIgnoreCase ) )
748
- {
749
- editorSession . PowerShellContext . AbortExecution ( ) ;
750
- }
751
- else if ( string . Equals ( "!break" , evaluateParams . Expression , StringComparison . CurrentCultureIgnoreCase ) )
751
+ if ( ! this . editorSession . ConsoleService . EnableConsoleRepl )
752
752
{
753
- editorSession . DebugService . Break ( ) ;
753
+ // Check for special commands
754
+ if ( string . Equals ( "!ctrlc" , evaluateParams . Expression , StringComparison . CurrentCultureIgnoreCase ) )
755
+ {
756
+ editorSession . PowerShellContext . AbortExecution ( ) ;
757
+ }
758
+ else if ( string . Equals ( "!break" , evaluateParams . Expression , StringComparison . CurrentCultureIgnoreCase ) )
759
+ {
760
+ editorSession . DebugService . Break ( ) ;
761
+ }
762
+ else
763
+ {
764
+ // Send the input through the console service
765
+ var notAwaited =
766
+ this . editorSession
767
+ . PowerShellContext
768
+ . ExecuteScriptString ( evaluateParams . Expression , false , true )
769
+ . ConfigureAwait ( false ) ;
770
+ }
754
771
}
755
772
else
756
773
{
757
- // Send the input through the console service
758
- var notAwaited =
759
- this . editorSession
760
- . PowerShellContext
761
- . ExecuteScriptString ( evaluateParams . Expression , false , true )
762
- . ConfigureAwait ( false ) ;
774
+ await this . WriteUseIntegratedConsoleMessage ( ) ;
763
775
}
764
776
}
765
777
else
@@ -770,10 +782,11 @@ protected async Task HandleEvaluateRequest(
770
782
// has been resumed, return an empty result in this case.
771
783
if ( editorSession . PowerShellContext . IsDebuggerStopped )
772
784
{
773
- await editorSession . DebugService . EvaluateExpression (
774
- evaluateParams . Expression ,
775
- evaluateParams . FrameId ,
776
- isFromRepl ) ;
785
+ result =
786
+ await editorSession . DebugService . EvaluateExpression (
787
+ evaluateParams . Expression ,
788
+ evaluateParams . FrameId ,
789
+ isFromRepl ) ;
777
790
}
778
791
779
792
if ( result != null )
@@ -793,6 +806,17 @@ await requestContext.SendResult(
793
806
} ) ;
794
807
}
795
808
809
+ private async Task WriteUseIntegratedConsoleMessage ( )
810
+ {
811
+ await this . SendEvent (
812
+ OutputEvent . Type ,
813
+ new OutputEventBody
814
+ {
815
+ Output = "\n The Debug Console is no longer used for PowerShell debugging. Please use the 'PowerShell Integrated Console' to execute commands in the debugger. Run the 'PowerShell: Show Integrated Console' command to open it." ,
816
+ Category = "stderr"
817
+ } ) ;
818
+ }
819
+
796
820
#endregion
797
821
798
822
#region Event Handlers
0 commit comments