src/vs/editor/contrib/inlineCompletions/utils.ts/createDisposableRef
export function createDisposableRef<T>(object: T, disposable?: IDisposable): IReference<T> {
	return {
		object,
		dispose: () => disposable?.dispose(),
	};
}