@@ -47,6 +47,7 @@ import { DebugStorage } from 'vs/workbench/contrib/debug/common/debugStorage';
4747import { DebugTelemetry } from 'vs/workbench/contrib/debug/common/debugTelemetry' ;
4848import { DebugCompoundRoot } from 'vs/workbench/contrib/debug/common/debugCompoundRoot' ;
4949import { ICommandService } from 'vs/platform/commands/common/commands' ;
50+ import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput' ;
5051
5152export class DebugService implements IDebugService {
5253 declare readonly _serviceBrand : undefined ;
@@ -90,7 +91,8 @@ export class DebugService implements IDebugService {
9091 @IConfigurationService private readonly configurationService : IConfigurationService ,
9192 @IExtensionHostDebugService private readonly extensionHostDebugService : IExtensionHostDebugService ,
9293 @IActivityService private readonly activityService : IActivityService ,
93- @ICommandService private readonly commandService : ICommandService
94+ @ICommandService private readonly commandService : ICommandService ,
95+ @IQuickInputService private readonly quickInputService : IQuickInputService
9496 ) {
9597 this . toDispose = [ ] ;
9698
@@ -732,14 +734,16 @@ export class DebugService implements IDebugService {
732734 } ) ;
733735 }
734736
735- stopSession ( session : IDebugSession | undefined ) : Promise < any > {
737+ async stopSession ( session : IDebugSession | undefined ) : Promise < any > {
736738 if ( session ) {
737739 return session . terminate ( ) ;
738740 }
739741
740742 const sessions = this . model . getSessions ( ) ;
741743 if ( sessions . length === 0 ) {
742744 this . taskRunner . cancel ( ) ;
745+ // User might have cancelled starting of a debug session, and in some cases the quick pick is left open
746+ await this . quickInputService . cancel ( ) ;
743747 this . endInitializingState ( ) ;
744748 this . cancelTokens ( undefined ) ;
745749 }
0 commit comments