@@ -28,8 +28,11 @@ import { IModeService } from 'vs/editor/common/services/modeService';
28
28
import { IDialogService } from 'vs/platform/dialogs/common/dialogs' ;
29
29
import Severity from 'vs/base/common/severity' ;
30
30
import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry' ;
31
+ import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
31
32
32
33
const jsonRegistry = Registry . as < IJSONContributionRegistry > ( JSONExtensions . JSONContribution ) ;
34
+ const DEBUGGERS_AVAILABLE_KEY = 'debug.debuggersavailable' ;
35
+
33
36
export class AdapterManager implements IAdapterManager {
34
37
35
38
private debuggers : Debugger [ ] ;
@@ -49,12 +52,15 @@ export class AdapterManager implements IAdapterManager {
49
52
@IExtensionService private readonly extensionService : IExtensionService ,
50
53
@IContextKeyService contextKeyService : IContextKeyService ,
51
54
@IModeService private readonly modeService : IModeService ,
52
- @IDialogService private readonly dialogService : IDialogService
55
+ @IDialogService private readonly dialogService : IDialogService ,
56
+ @IStorageService private readonly storageService : IStorageService
53
57
) {
54
58
this . adapterDescriptorFactories = [ ] ;
55
59
this . debuggers = [ ] ;
56
60
this . registerListeners ( ) ;
61
+ const debuggersAvailable = this . storageService . getBoolean ( DEBUGGERS_AVAILABLE_KEY , StorageScope . WORKSPACE , false ) ;
57
62
this . debuggersAvailable = CONTEXT_DEBUGGERS_AVAILABLE . bindTo ( contextKeyService ) ;
63
+ this . debuggersAvailable . set ( debuggersAvailable ) ;
58
64
}
59
65
60
66
private registerListeners ( ) : void {
@@ -158,6 +164,7 @@ export class AdapterManager implements IAdapterManager {
158
164
registerDebugAdapterFactory ( debugTypes : string [ ] , debugAdapterLauncher : IDebugAdapterFactory ) : IDisposable {
159
165
debugTypes . forEach ( debugType => this . debugAdapterFactories . set ( debugType , debugAdapterLauncher ) ) ;
160
166
this . debuggersAvailable . set ( this . debugAdapterFactories . size > 0 ) ;
167
+ this . storageService . store ( DEBUGGERS_AVAILABLE_KEY , this . debugAdapterFactories . size > 0 , StorageScope . WORKSPACE , StorageTarget . MACHINE ) ;
161
168
this . _onDidRegisterDebugger . fire ( ) ;
162
169
163
170
return {
0 commit comments