src/vs/editor/browser/widget/codeEditorWidget.ts/EditorModeContext/constructor
class EditorModeContext:	constructor(
		private readonly _editor: CodeEditorWidget,
		private readonly _contextKeyService: IContextKeyService,
		private readonly _languageFeaturesService: ILanguageFeaturesService,
	) {
		super();

		this._langId = EditorContextKeys.languageId.bindTo(_contextKeyService);
		this._hasCompletionItemProvider = EditorContextKeys.hasCompletionItemProvider.bindTo(_contextKeyService);
		this._hasCodeActionsProvider = EditorContextKeys.hasCodeActionsProvider.bindTo(_contextKeyService);
		this._hasCodeLensProvider = EditorContextKeys.hasCodeLensProvider.bindTo(_contextKeyService);
		this._hasDefinitionProvider = EditorContextKeys.hasDefinitionProvider.bindTo(_contextKeyService);
		this._hasDeclarationProvider = EditorContextKeys.hasDeclarationProvider.bindTo(_contextKeyService);
		this._hasImplementationProvider = EditorContextKeys.hasImplementationProvider.bindTo(_contextKeyService);
		this._hasTypeDefinitionProvider = EditorContextKeys.hasTypeDefinitionProvider.bindTo(_contextKeyService);
		this._hasHoverProvider = EditorContextKeys.hasHoverProvider.bindTo(_contextKeyService);
		this._hasDocumentHighlightProvider = EditorContextKeys.hasDocumentHighlightProvider.bindTo(_contextKeyService);
		this._hasDocumentSymbolProvider = EditorContextKeys.hasDocumentSymbolProvider.bindTo(_contextKeyService);
		this._hasReferenceProvider = EditorContextKeys.hasReferenceProvider.bindTo(_contextKeyService);
		this._hasRenameProvider = EditorContextKeys.hasRenameProvider.bindTo(_contextKeyService);
		this._hasSignatureHelpProvider = EditorContextKeys.hasSignatureHelpProvider.bindTo(_contextKeyService);
		this._hasInlayHintsProvider = EditorContextKeys.hasInlayHintsProvider.bindTo(_contextKeyService);
		this._hasDocumentFormattingProvider = EditorContextKeys.hasDocumentFormattingProvider.bindTo(_contextKeyService);
		this._hasDocumentSelectionFormattingProvider = EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(_contextKeyService);
		this._hasMultipleDocumentFormattingProvider = EditorContextKeys.hasMultipleDocumentFormattingProvider.bindTo(_contextKeyService);
		this._hasMultipleDocumentSelectionFormattingProvider = EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider.bindTo(_contextKeyService);
		this._isInWalkThrough = EditorContextKeys.isInWalkThroughSnippet.bindTo(_contextKeyService);

		const update = () => this._update();

		// update when model/mode changes
		this._register(_editor.onDidChangeModel(update));
		this._register(_editor.onDidChangeModelLanguage(update));

		// update when registries change
		this._register(_languageFeaturesService.completionProvider.onDidChange(update));
		this._register(_languageFeaturesService.codeActionProvider.onDidChange(update));
		this._register(_languageFeaturesService.codeLensProvider.onDidChange(update));
		this._register(_languageFeaturesService.definitionProvider.onDidChange(update));
		this._register(_languageFeaturesService.declarationProvider.onDidChange(update));
		this._register(_languageFeaturesService.implementationProvider.onDidChange(update));
		this._register(_languageFeaturesService.typeDefinitionProvider.onDidChange(update));
		this._register(_languageFeaturesService.hoverProvider.onDidChange(update));
		this._register(_languageFeaturesService.documentHighlightProvider.onDidChange(update));
		this._register(_languageFeaturesService.documentSymbolProvider.onDidChange(update));
		this._register(_languageFeaturesService.referenceProvider.onDidChange(update));
		this._register(_languageFeaturesService.renameProvider.onDidChange(update));
		this._register(_languageFeaturesService.documentFormattingEditProvider.onDidChange(update));
		this._register(_languageFeaturesService.documentRangeFormattingEditProvider.onDidChange(update));
		this._register(_languageFeaturesService.signatureHelpProvider.onDidChange(update));
		this._register(_languageFeaturesService.inlayHintsProvider.onDidChange(update));

		update();
	}