src/vs/platform/history/browser/contextScopedHistoryWidget.ts/getContextScopedWidget
function getContextScopedWidget<T extends IContextScopedWidget>(contextKeyService: IContextKeyService, contextKey: string): T | undefined {
	return contextKeyService.getContext(document.activeElement).getValue(contextKey);
}