From 2cd36100c46f25aea9e41581fa975b7b3350dad7 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 6 Jun 2019 15:30:05 +0200 Subject: [PATCH] Revert "Update more places where we are using an IDispoable[]" This reverts commit 869e5921d8257e81217dfdb3603e6663b50ded65. --- .../contrib/codelens/codelensController.ts | 45 +++++++------- .../goToDefinition/goToDefinitionMouse.ts | 19 +++--- src/vs/editor/contrib/gotoError/gotoError.ts | 15 +++-- .../browser/mainThreadDocumentsAndEditors.ts | 59 ++++++++++++------- .../api/browser/mainThreadEditors.ts | 19 +++--- 5 files changed, 92 insertions(+), 65 deletions(-) diff --git a/src/vs/editor/contrib/codelens/codelensController.ts b/src/vs/editor/contrib/codelens/codelensController.ts index b4b0052b090..04a77dcf931 100644 --- a/src/vs/editor/contrib/codelens/codelensController.ts +++ b/src/vs/editor/contrib/codelens/codelensController.ts @@ -5,7 +5,7 @@ import { CancelablePromise, RunOnceScheduler, createCancelablePromise, disposableTimeout } from 'vs/base/common/async'; import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { toDisposable, Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { StableEditorScrollState } from 'vs/editor/browser/core/editorState'; import * as editorBrowser from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; @@ -13,19 +13,20 @@ import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOption import * as editorCommon from 'vs/editor/common/editorCommon'; import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; import { CodeLensProviderRegistry, CodeLens } from 'vs/editor/common/modes'; -import { getCodeLensData, CodeLensModel, CodeLensItem } from 'vs/editor/contrib/codelens/codelens'; +import { CodeLensModel, getCodeLensData, CodeLensItem } from 'vs/editor/contrib/codelens/codelens'; import { CodeLensWidget, CodeLensHelper } from 'vs/editor/contrib/codelens/codelensWidget'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ICodeLensCache } from 'vs/editor/contrib/codelens/codeLensCache'; -export class CodeLensContribution extends Disposable implements editorCommon.IEditorContribution { +export class CodeLensContribution implements editorCommon.IEditorContribution { private static readonly ID: string = 'css.editor.codeLens'; private _isEnabled: boolean; - private readonly _localToDispose = this._register(new DisposableStore()); + private _globalToDispose: IDisposable[] = []; + private _localToDispose: IDisposable[] = []; private _lenses: CodeLensWidget[] = []; private _currentFindCodeLensSymbolsPromise: CancelablePromise | undefined; private _currentCodeLensModel: CodeLensModel | undefined; @@ -39,29 +40,25 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd @INotificationService private readonly _notificationService: INotificationService, @ICodeLensCache private readonly _codeLensCache: ICodeLensCache ) { - super(); this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; - this._lenses = []; - this._currentFindCodeLensSymbolsPromise = undefined; - this._modelChangeCounter = 0; - this._register(this._editor.onDidChangeModel(() => this._onModelChange())); - this._register(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); - this._register(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { + this._globalToDispose.push(this._editor.onDidChangeModel(() => this._onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { let prevIsEnabled = this._isEnabled; this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; if (prevIsEnabled !== this._isEnabled) { this._onModelChange(); } })); - this._register(CodeLensProviderRegistry.onDidChange(this._onModelChange, this)); + this._globalToDispose.push(CodeLensProviderRegistry.onDidChange(this._onModelChange, this)); this._onModelChange(); } dispose(): void { this._localDispose(); - super.dispose(); + this._globalToDispose = dispose(this._globalToDispose); } private _localDispose(): void { @@ -74,7 +71,7 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd this._currentResolveCodeLensSymbolsPromise.cancel(); this._currentResolveCodeLensSymbolsPromise = undefined; } - this._localToDispose.clear(); + this._localToDispose = dispose(this._localToDispose); dispose(this._currentCodeLensModel); } @@ -104,7 +101,7 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd // no provider -> return but check with // cached lenses. they expire after 30 seconds if (cachedLenses) { - this._localToDispose.add(disposableTimeout(() => { + this._localToDispose.push(disposableTimeout(() => { const cachedLensesNow = this._codeLensCache.get(model); if (cachedLenses === cachedLensesNow) { this._codeLensCache.delete(model); @@ -118,7 +115,7 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd for (const provider of CodeLensProviderRegistry.all(model)) { if (typeof provider.onDidChange === 'function') { let registration = provider.onDidChange(() => scheduler.schedule()); - this._localToDispose.add(registration); + this._localToDispose.push(registration); } } @@ -149,9 +146,9 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd } }, onUnexpectedError); }, 250); - this._localToDispose.add(scheduler); - this._localToDispose.add(this._detectVisibleLenses); - this._localToDispose.add(this._editor.onDidChangeModelContent((e) => { + this._localToDispose.push(scheduler); + this._localToDispose.push(this._detectVisibleLenses); + this._localToDispose.push(this._editor.onDidChangeModelContent((e) => { this._editor.changeDecorations((changeAccessor) => { this._editor.changeViewZones((viewAccessor) => { let toDispose: CodeLensWidget[] = []; @@ -183,15 +180,15 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd // Ask for all references again scheduler.schedule(); })); - this._localToDispose.add(this._editor.onDidScrollChange(e => { + this._localToDispose.push(this._editor.onDidScrollChange(e => { if (e.scrollTopChanged && this._lenses.length > 0) { this._detectVisibleLenses.schedule(); } })); - this._localToDispose.add(this._editor.onDidLayoutChange(e => { + this._localToDispose.push(this._editor.onDidLayoutChange(e => { this._detectVisibleLenses.schedule(); })); - this._localToDispose.add(toDisposable(() => { + this._localToDispose.push(toDisposable(() => { if (this._editor.getModel()) { const scrollState = StableEditorScrollState.capture(this._editor); this._editor.changeDecorations((changeAccessor) => { @@ -205,14 +202,14 @@ export class CodeLensContribution extends Disposable implements editorCommon.IEd this._disposeAllLenses(undefined, undefined); } })); - this._localToDispose.add(this._editor.onDidChangeConfiguration(e => { + this._localToDispose.push(this._editor.onDidChangeConfiguration(e => { if (e.fontInfo) { for (const lens of this._lenses) { lens.updateHeight(); } } })); - this._localToDispose.add(this._editor.onMouseUp(e => { + this._localToDispose.push(this._editor.onMouseUp(e => { if (e.target.type === editorBrowser.MouseTargetType.CONTENT_WIDGET && e.target.element && e.target.element.tagName === 'A') { for (const lens of this._lenses) { let command = lens.getCommand(e.target.element as HTMLLinkElement); diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts index 45314c2d1ab..2f36e372857 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts @@ -16,7 +16,7 @@ import { DefinitionProviderRegistry, LocationLink } from 'vs/editor/common/modes import { ICodeEditor, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { getDefinitionsAtPosition } from './goToDefinition'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; @@ -27,12 +27,13 @@ import { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } fro import { Position } from 'vs/editor/common/core/position'; import { withNullAsUndefined } from 'vs/base/common/types'; -class GotoDefinitionWithMouseEditorContribution extends Disposable implements editorCommon.IEditorContribution { +class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { private static readonly ID = 'editor.contrib.gotodefinitionwithmouse'; static MAX_SOURCE_PREVIEW_LINES = 8; private readonly editor: ICodeEditor; + private toUnhook: IDisposable[]; private decorations: string[]; private currentWordUnderMouse: IWordAtPosition | null; private previousPromise: CancelablePromise | null; @@ -42,19 +43,19 @@ class GotoDefinitionWithMouseEditorContribution extends Disposable implements ed @ITextModelService private readonly textModelResolverService: ITextModelService, @IModeService private readonly modeService: IModeService ) { - super(); + this.toUnhook = []; this.decorations = []; this.editor = editor; this.previousPromise = null; let linkGesture = new ClickLinkGesture(editor); - this._register(linkGesture); + this.toUnhook.push(linkGesture); - this._register(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { + this.toUnhook.push(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { this.startFindDefinition(mouseEvent, withNullAsUndefined(keyboardEvent)); })); - this._register(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => { + this.toUnhook.push(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => { if (this.isEnabled(mouseEvent)) { this.gotoDefinition(mouseEvent.target, mouseEvent.hasSideBySideModifier).then(() => { this.removeDecorations(); @@ -65,7 +66,7 @@ class GotoDefinitionWithMouseEditorContribution extends Disposable implements ed } })); - this._register(linkGesture.onCancel(() => { + this.toUnhook.push(linkGesture.onCancel(() => { this.removeDecorations(); this.currentWordUnderMouse = null; })); @@ -300,6 +301,10 @@ class GotoDefinitionWithMouseEditorContribution extends Disposable implements ed public getId(): string { return GotoDefinitionWithMouseEditorContribution.ID; } + + public dispose(): void { + this.toUnhook = dispose(this.toUnhook); + } } registerEditorContribution(GotoDefinitionWithMouseEditorContribution); diff --git a/src/vs/editor/contrib/gotoError/gotoError.ts b/src/vs/editor/contrib/gotoError/gotoError.ts index d865ad9bb6d..4a9a2aa118d 100644 --- a/src/vs/editor/contrib/gotoError/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/gotoError.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { Emitter } from 'vs/base/common/event'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; @@ -27,28 +27,29 @@ import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { Action } from 'vs/base/common/actions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -class MarkerModel extends Disposable { +class MarkerModel { private readonly _editor: ICodeEditor; private _markers: IMarker[]; private _nextIdx: number; + private _toUnbind: IDisposable[]; private _ignoreSelectionChange: boolean; private readonly _onCurrentMarkerChanged: Emitter; private readonly _onMarkerSetChanged: Emitter; constructor(editor: ICodeEditor, markers: IMarker[]) { - super(); this._editor = editor; this._markers = []; this._nextIdx = -1; + this._toUnbind = []; this._ignoreSelectionChange = false; this._onCurrentMarkerChanged = new Emitter(); this._onMarkerSetChanged = new Emitter(); this.setMarkers(markers); // listen on editor - this._register(this._editor.onDidDispose(() => this.dispose())); - this._register(this._editor.onDidChangeCursorPosition(() => { + this._toUnbind.push(this._editor.onDidDispose(() => this.dispose())); + this._toUnbind.push(this._editor.onDidChangeCursorPosition(() => { if (this._ignoreSelectionChange) { return; } @@ -187,6 +188,10 @@ class MarkerModel extends Disposable { public indexOf(marker: IMarker): number { return 1 + this._markers.indexOf(marker); } + + public dispose(): void { + this._toUnbind = dispose(this._toUnbind); + } } export class MarkerController implements editorCommon.IEditorContribution { diff --git a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts index 9ac6192df62..5c8a9b248bb 100644 --- a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, combinedDisposable, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecycle'; import { values } from 'vs/base/common/map'; import { URI } from 'vs/base/common/uri'; import { ICodeEditor, isCodeEditor, isDiffEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; @@ -142,8 +142,9 @@ const enum ActiveEditorOrder { Editor, Panel } -class MainThreadDocumentAndEditorStateComputer extends Disposable { +class MainThreadDocumentAndEditorStateComputer { + private _toDispose: IDisposable[] = []; private _toDisposeOnEditorRemove = new Map(); private _currentState: DocumentAndEditorState; private _activeEditorOrder: ActiveEditorOrder = ActiveEditorOrder.Editor; @@ -155,22 +156,25 @@ class MainThreadDocumentAndEditorStateComputer extends Disposable { @IEditorService private readonly _editorService: IEditorService, @IPanelService private readonly _panelService: IPanelService ) { - super(); - this._register(this._modelService.onModelAdded(this._updateStateOnModelAdd, this)); - this._register(this._modelService.onModelRemoved(_ => this._updateState(), this)); - this._register(this._editorService.onDidActiveEditorChange(_ => this._updateState(), this)); + this._modelService.onModelAdded(this._updateStateOnModelAdd, this, this._toDispose); + this._modelService.onModelRemoved(_ => this._updateState(), this, this._toDispose); + this._editorService.onDidActiveEditorChange(_ => this._updateState(), this, this._toDispose); - this._register(this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor, this)); - this._register(this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor, this)); + this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor, this, this._toDispose); + this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor, this, this._toDispose); this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor, this); - this._register(this._panelService.onDidPanelOpen(_ => this._activeEditorOrder = ActiveEditorOrder.Panel, undefined)); - this._register(this._panelService.onDidPanelClose(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined)); - this._register(this._editorService.onDidVisibleEditorsChange(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined)); + this._panelService.onDidPanelOpen(_ => this._activeEditorOrder = ActiveEditorOrder.Panel, undefined, this._toDispose); + this._panelService.onDidPanelClose(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined, this._toDispose); + this._editorService.onDidVisibleEditorsChange(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined, this._toDispose); this._updateState(); } + dispose(): void { + this._toDispose = dispose(this._toDispose); + } + private _onDidAddEditor(e: ICodeEditor): void { this._toDisposeOnEditorRemove.set(e.getId(), combinedDisposable( e.onDidChangeModel(() => this._updateState()), @@ -298,15 +302,17 @@ class MainThreadDocumentAndEditorStateComputer extends Disposable { } @extHostCustomer -export class MainThreadDocumentsAndEditors extends Disposable { +export class MainThreadDocumentsAndEditors { + private _toDispose: IDisposable[]; private readonly _proxy: ExtHostDocumentsAndEditorsShape; + private readonly _stateComputer: MainThreadDocumentAndEditorStateComputer; private _textEditors = <{ [id: string]: MainThreadTextEditor }>Object.create(null); - private _onTextEditorAdd = this._register(new Emitter()); - private _onTextEditorRemove = this._register(new Emitter()); - private _onDocumentAdd = this._register(new Emitter()); - private _onDocumentRemove = this._register(new Emitter()); + private _onTextEditorAdd = new Emitter(); + private _onTextEditorRemove = new Emitter(); + private _onDocumentAdd = new Emitter(); + private _onDocumentRemove = new Emitter(); readonly onTextEditorAdd: Event = this._onTextEditorAdd.event; readonly onTextEditorRemove: Event = this._onTextEditorRemove.event; @@ -328,17 +334,30 @@ export class MainThreadDocumentsAndEditors extends Disposable { @IPanelService panelService: IPanelService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService ) { - super(); this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocumentsAndEditors); - const mainThreadDocuments = this._register(new MainThreadDocuments(this, extHostContext, this._modelService, modeService, this._textFileService, fileService, textModelResolverService, untitledEditorService, environmentService)); + const mainThreadDocuments = new MainThreadDocuments(this, extHostContext, this._modelService, modeService, this._textFileService, fileService, textModelResolverService, untitledEditorService, environmentService); extHostContext.set(MainContext.MainThreadDocuments, mainThreadDocuments); - const mainThreadTextEditors = this._register(new MainThreadTextEditors(this, extHostContext, codeEditorService, bulkEditService, this._editorService, this._editorGroupService)); + const mainThreadTextEditors = new MainThreadTextEditors(this, extHostContext, codeEditorService, bulkEditService, this._editorService, this._editorGroupService); extHostContext.set(MainContext.MainThreadTextEditors, mainThreadTextEditors); // It is expected that the ctor of the state computer calls our `_onDelta`. - this._register(new MainThreadDocumentAndEditorStateComputer(delta => this._onDelta(delta), _modelService, codeEditorService, this._editorService, panelService)); + this._stateComputer = new MainThreadDocumentAndEditorStateComputer(delta => this._onDelta(delta), _modelService, codeEditorService, this._editorService, panelService); + + this._toDispose = [ + mainThreadDocuments, + mainThreadTextEditors, + this._stateComputer, + this._onTextEditorAdd, + this._onTextEditorRemove, + this._onDocumentAdd, + this._onDocumentRemove, + ]; + } + + dispose(): void { + this._toDispose = dispose(this._toDispose); } private _onDelta(delta: DocumentAndEditorStateDelta): void { diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index 4eaf703eb37..9dfff56540a 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -5,7 +5,7 @@ import { localize } from 'vs/nls'; import { disposed } from 'vs/base/common/errors'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { equals as objectEquals } from 'vs/base/common/objects'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; @@ -25,13 +25,14 @@ import { EditorViewColumn, editorGroupToViewColumn, viewColumnToEditorGroup } fr import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -export class MainThreadTextEditors extends Disposable implements MainThreadTextEditorsShape { +export class MainThreadTextEditors implements MainThreadTextEditorsShape { private static INSTANCE_COUNT: number = 0; private readonly _instanceId: string; private readonly _proxy: ExtHostEditorsShape; private readonly _documentsAndEditors: MainThreadDocumentsAndEditors; + private _toDispose: IDisposable[]; private _textEditorsListenersMap: { [editorId: string]: IDisposable[]; }; private _editorPositionData: ITextEditorPositionData | null; private _registeredDecorationTypes: { [decorationType: string]: boolean; }; @@ -44,29 +45,29 @@ export class MainThreadTextEditors extends Disposable implements MainThreadTextE @IEditorService private readonly _editorService: IEditorService, @IEditorGroupsService private readonly _editorGroupService: IEditorGroupsService ) { - super(); this._instanceId = String(++MainThreadTextEditors.INSTANCE_COUNT); this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostEditors); this._documentsAndEditors = documentsAndEditors; + this._toDispose = []; this._textEditorsListenersMap = Object.create(null); this._editorPositionData = null; - this._register(documentsAndEditors.onTextEditorAdd(editors => editors.forEach(this._onTextEditorAdd, this))); - this._register(documentsAndEditors.onTextEditorRemove(editors => editors.forEach(this._onTextEditorRemove, this))); + this._toDispose.push(documentsAndEditors.onTextEditorAdd(editors => editors.forEach(this._onTextEditorAdd, this))); + this._toDispose.push(documentsAndEditors.onTextEditorRemove(editors => editors.forEach(this._onTextEditorRemove, this))); - this._register(this._editorService.onDidVisibleEditorsChange(() => this._updateActiveAndVisibleTextEditors())); - this._register(this._editorGroupService.onDidRemoveGroup(() => this._updateActiveAndVisibleTextEditors())); - this._register(this._editorGroupService.onDidMoveGroup(() => this._updateActiveAndVisibleTextEditors())); + this._toDispose.push(this._editorService.onDidVisibleEditorsChange(() => this._updateActiveAndVisibleTextEditors())); + this._toDispose.push(this._editorGroupService.onDidRemoveGroup(() => this._updateActiveAndVisibleTextEditors())); + this._toDispose.push(this._editorGroupService.onDidMoveGroup(() => this._updateActiveAndVisibleTextEditors())); this._registeredDecorationTypes = Object.create(null); } public dispose(): void { - super.dispose(); Object.keys(this._textEditorsListenersMap).forEach((editorId) => { dispose(this._textEditorsListenersMap[editorId]); }); this._textEditorsListenersMap = Object.create(null); + this._toDispose = dispose(this._toDispose); for (let decorationType in this._registeredDecorationTypes) { this._codeEditorService.removeDecorationType(decorationType); }