third time's the charm
This commit is contained in:
isidor 2021-06-24 15:04:21 +02:00
parent 8bdf5f4740
commit 2ce8c97bc2
No known key found for this signature in database
GPG key ID: F9280366A8370105
2 changed files with 2 additions and 9 deletions

View file

@ -28,10 +28,8 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import Severity from 'vs/base/common/severity';
import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
const DEBUGGERS_AVAILABLE_KEY = 'debug.debuggersavailable';
export class AdapterManager implements IAdapterManager {
@ -53,14 +51,11 @@ export class AdapterManager implements IAdapterManager {
@IContextKeyService contextKeyService: IContextKeyService,
@IModeService private readonly modeService: IModeService,
@IDialogService private readonly dialogService: IDialogService,
@IStorageService private readonly storageService: IStorageService
) {
this.adapterDescriptorFactories = [];
this.debuggers = [];
this.registerListeners();
const debuggersAvailable = this.storageService.getBoolean(DEBUGGERS_AVAILABLE_KEY, StorageScope.WORKSPACE, false);
this.debuggersAvailable = CONTEXT_DEBUGGERS_AVAILABLE.bindTo(contextKeyService);
this.debuggersAvailable.set(debuggersAvailable);
}
private registerListeners(): void {
@ -164,7 +159,6 @@ export class AdapterManager implements IAdapterManager {
registerDebugAdapterFactory(debugTypes: string[], debugAdapterLauncher: IDebugAdapterFactory): IDisposable {
debugTypes.forEach(debugType => this.debugAdapterFactories.set(debugType, debugAdapterLauncher));
this.debuggersAvailable.set(this.debugAdapterFactories.size > 0);
this.storageService.store(DEBUGGERS_AVAILABLE_KEY, this.debugAdapterFactories.size > 0, StorageScope.WORKSPACE, StorageTarget.MACHINE);
this._onDidRegisterDebugger.fire();
return {

View file

@ -137,6 +137,8 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
this.multiSessionRepl = CONTEXT_MULTI_SESSION_REPL.bindTo(contextKeyService);
codeEditorService.registerDecorationType('repl-decoration', DECORATION_KEY, {});
this.multiSessionRepl.set(this.isMultiSessionView);
this.registerListeners();
}
private registerListeners(): void {
@ -541,9 +543,6 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
protected override renderBody(parent: HTMLElement): void {
super.renderBody(parent);
this.container = dom.append(parent, $('.repl'));
// Only depend on debug service in renderBody not in constructor to no have cyclic dependency
this.multiSessionRepl.set(this.isMultiSessionView);
this.registerListeners();
this.treeContainer = dom.append(this.container, $(`.repl-tree.${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`));
this.createReplInput(this.container);
this.createReplTree();