src/vs/workbench/contrib/folding/browser/folding.contribution.ts/FoldingLimitIndicatorContribution/constructor
class FoldingLimitIndicatorContribution:	constructor(
		@IEditorService private readonly editorService: IEditorService,
		@ILanguageStatusService private readonly languageStatusService: ILanguageStatusService
	) {
		super();

		let changeListener: IDisposable | undefined;
		let control: any;

		const onActiveEditorChanged = () => {
			const activeControl = editorService.activeTextEditorControl;
			if (activeControl === control) {
				return;
			}
			control = undefined;
			if (changeListener) {
				changeListener.dispose();
				changeListener = undefined;
			}
			const editor = getCodeEditor(activeControl);
			if (editor) {
				const controller = FoldingController.get(editor);
				if (controller) {
					const info = controller.foldingLimitInfo;
					this.updateLimitInfo(info);
					control = activeControl;
					changeListener = controller.onDidChangeFoldingLimit(info => {
						this.updateLimitInfo(info);
					});
				} else {
					this.updateLimitInfo(undefined);
				}
			} else {
				this.updateLimitInfo(undefined);
			}
		};

		this._register(this.editorService.onDidActiveEditorChange(onActiveEditorChanged));

		onActiveEditorChanged();
	}