Reduce state in buffer decorations

This commit is contained in:
Daniel Imms
2022-03-14 15:48:09 -07:00
parent c8d1266f0a
commit 4b615f48ff
5 changed files with 55 additions and 127 deletions
+2
View File
@@ -17,6 +17,8 @@ export class DecorationService extends Disposable implements IDecorationService
public get onDecorationRemoved(): IEvent<IInternalDecoration> { return this._onDecorationRemoved.event; }
private _decorations: IInternalDecoration[] = [];
public get decorations(): IterableIterator<IInternalDecoration> { return this._decorations.values(); }
constructor() {
super();
}
+1
View File
@@ -303,6 +303,7 @@ export interface IUnicodeVersionProvider {
export const IDecorationService = createDecorator<IDecorationService>('DecorationService');
export interface IDecorationService extends IDisposable {
readonly decorations: IterableIterator<IInternalDecoration>;
readonly onDecorationRegistered: IEvent<IInternalDecoration>;
readonly onDecorationRemoved: IEvent<IInternalDecoration>;
registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;