mirror of
https://github.com/Microsoft/vscode
synced 2024-09-30 00:11:47 +00:00
Fix a few double disposable registrations (#224895)
These values are being registered on a disposable store more than once. I think some of the instances in tests are actually leaking the `MutableObservableValue` too since it's not registered
This commit is contained in:
parent
8b232e3eab
commit
5cc310c11b
|
@ -437,8 +437,7 @@ export class SearchWidget extends Widget {
|
||||||
|
|
||||||
protected createInputBox(parent: HTMLElement): HistoryInputBox {
|
protected createInputBox(parent: HTMLElement): HistoryInputBox {
|
||||||
const showHistoryHint = () => showHistoryKeybindingHint(this.keybindingService);
|
const showHistoryHint = () => showHistoryKeybindingHint(this.keybindingService);
|
||||||
const box = this._register(new ContextScopedHistoryInputBox(parent, this.contextViewService, { ...this.options, showHistoryHint }, this.contextKeyService));
|
return new ContextScopedHistoryInputBox(parent, this.contextViewService, { ...this.options, showHistoryHint }, this.contextKeyService);
|
||||||
return box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showMessage(message: string): void {
|
showMessage(message: string): void {
|
||||||
|
|
|
@ -92,18 +92,18 @@ export class TestingPeekOpener extends Disposable implements ITestingPeekOpener
|
||||||
private lastUri?: TestUriWithDocument;
|
private lastUri?: TestUriWithDocument;
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
public readonly historyVisible = MutableObservableValue.stored(this._register(new StoredValue<boolean>({
|
public readonly historyVisible = this._register(MutableObservableValue.stored(new StoredValue<boolean>({
|
||||||
key: 'testHistoryVisibleInPeek',
|
key: 'testHistoryVisibleInPeek',
|
||||||
scope: StorageScope.PROFILE,
|
scope: StorageScope.PROFILE,
|
||||||
target: StorageTarget.USER,
|
target: StorageTarget.USER,
|
||||||
}, this.storageService)), false);
|
}, this.storageService), false));
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
public readonly callStackVisible = MutableObservableValue.stored(this._register(new StoredValue<boolean>({
|
public readonly callStackVisible = this._register(MutableObservableValue.stored(new StoredValue<boolean>({
|
||||||
key: 'testCallStackVisible',
|
key: 'testCallStackVisible',
|
||||||
scope: StorageScope.PROFILE,
|
scope: StorageScope.PROFILE,
|
||||||
target: StorageTarget.USER,
|
target: StorageTarget.USER,
|
||||||
}, this.storageService)), true);
|
}, this.storageService), true));
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IConfigurationService private readonly configuration: IConfigurationService,
|
@IConfigurationService private readonly configuration: IConfigurationService,
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { InternalTestItem } from 'vs/workbench/contrib/testing/common/testTypes'
|
||||||
|
|
||||||
export class TestExclusions extends Disposable {
|
export class TestExclusions extends Disposable {
|
||||||
private readonly excluded = this._register(
|
private readonly excluded = this._register(
|
||||||
MutableObservableValue.stored(this._register(new StoredValue<ReadonlySet<string>>({
|
MutableObservableValue.stored(new StoredValue<ReadonlySet<string>>({
|
||||||
key: 'excludedTestItems',
|
key: 'excludedTestItems',
|
||||||
scope: StorageScope.WORKSPACE,
|
scope: StorageScope.WORKSPACE,
|
||||||
target: StorageTarget.MACHINE,
|
target: StorageTarget.MACHINE,
|
||||||
|
@ -21,7 +21,7 @@ export class TestExclusions extends Disposable {
|
||||||
deserialize: v => new Set(JSON.parse(v)),
|
deserialize: v => new Set(JSON.parse(v)),
|
||||||
serialize: v => JSON.stringify([...v])
|
serialize: v => JSON.stringify([...v])
|
||||||
},
|
},
|
||||||
}, this.storageService)), new Set())
|
}, this.storageService), new Set())
|
||||||
);
|
);
|
||||||
|
|
||||||
constructor(@IStorageService private readonly storageService: IStorageService) {
|
constructor(@IStorageService private readonly storageService: IStorageService) {
|
||||||
|
|
|
@ -82,11 +82,11 @@ export class TestService extends Disposable implements ITestService {
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public readonly showInlineOutput = MutableObservableValue.stored(this._register(new StoredValue<boolean>({
|
public readonly showInlineOutput = this._register(MutableObservableValue.stored(new StoredValue<boolean>({
|
||||||
key: 'inlineTestOutputVisible',
|
key: 'inlineTestOutputVisible',
|
||||||
scope: StorageScope.WORKSPACE,
|
scope: StorageScope.WORKSPACE,
|
||||||
target: StorageTarget.USER
|
target: StorageTarget.USER
|
||||||
}, this.storage)), true);
|
}, this.storage), true));
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IContextKeyService contextKeyService: IContextKeyService,
|
@IContextKeyService contextKeyService: IContextKeyService,
|
||||||
|
|
Loading…
Reference in a new issue