当前位置: 首页 > article >正文

VsCode/Cursor workbench.desktop.main.js 的入口

这个也是main函数开始的,下面就是最后一行代码,表示export出rSo 函数作为它的名字公开为main, 和dll export表有点像了。

	export {
				rSo as main
			}; 


其中rSO是

function rSo(i) {
	return new nSo(i).open()
}

nSO是一个类,应该是就是workbenchMain了。

var nSo = class extends V {
	constructor(i) {
		super(), this.a = i, this.b()
	}
	b() {
		this.c(), fle(!!this.a.fullscreen, _t)
	}
	c() {
		const i = YCn(this.a.workspace);
		(oN(i) || mC(i)) && (this.a.workspace = i);
		const e = this.a.filesToWait,
			t = e ? .paths;
		for (const s of [t, this.a.filesToOpenOrCreate, this.a.filesToDiff, this.a.filesToMerge])
			if (Array.isArray(s))
				for (const n of s) n.fileUri && (n.fileUri = W.revive(n.fileUri));
		e && (e.waitMarkerFileUri = W.revive(e.waitMarkerFileUri))
	}
	async open() {
		const [i] = await Promise.all([this.j(), H0n(_t)]);
		this.f(i.configurationService);
		const e = new T0o(_t.document.body, {
			extraClasses: this.g()
		}, i.serviceCollection, i.logService);
		this.h(e, i.storageService);
		const t = e.startup();
		this.D(t.createInstance(dCt))
	}
	f(i) {
		let e;
		if (this.a.isCustomZoomLevel && typeof this.a.zoomLevel == "number") e = this.a.zoomLevel;
		else {
			const t = i.getValue();
			e = typeof t.window ? .zoomLevel == "number" ? t.window.zoomLevel : 0
		}
		rxe(e, _t)
	}
	g() {
		return Bt && LRi(this.a.os.release) ? ["macos-bigsur-or-newer"] : []
	}
	h(i, e) {
		this.D(i.onWillShutdown(t => t.join(e.close(), {
			id: "join.closeStorage",
			label: f(12421, null)
		}))), this.D(i.onDidShutdown(() => this.dispose()))
	}
	async j() {
		const i = new Da,
			e = this.D(new VCo(this.a.windowId));
		i.set(mI, e);
		const t = this.a.policiesData ? new YCo(this.a.policiesData, e.getChannel("policy")) : new Esn;
		i.set(ksn, t);
		const s = {
			_serviceBrand: void 0,
			...ao
		};
		i.set(os, s);
		const n = new Gf(this.a, s);
		i.set(Vl, n);
		const r = [...this.a.loggers.global.map(D => ({ ...D,
				resource: W.revive(D.resource)
			})), ...this.a.loggers.window.map(D => ({ ...D,
				resource: W.revive(D.resource),
				hidden: !0
			}))],
			o = new Pho(this.a.windowId, this.a.logLevel, n.windowLogsPath, r, e.getChannel("logger"));
		i.set(Ip, o);
		const a = this.D(new jCo(o, n));
		i.set(Ft, a), av && a.info("workbench#open()"), a.getLevel() === Un.Trace && a.trace("workbench#open(): with configuration", Nze({ ...this.a,
			nls: void 0
		}));
		const l = new KCi(this.a.windowId, a);
		i.set(f5, l);
		const c = new FCi(this.a.windowId, a, e);
		i.set(gsn, c);
		const u = JE.toService(e.getChannel("sign"));
		i.set(bCt, u);
		const h = this.D(new tSi(a));
		i.set(yt, h);
		const d = new YCi(s, new rSi(n.window.id, e, h));
		i.set(Ym, d);
		const g = this.D(new GCo(e, c, a, o));
		h.registerProvider(me.file, g);
		const p = new yCt(h);
		i.set(bs, p);
		const m = new c8s(this.a.profiles.all, W.revive(this.a.profiles.home).with({
			scheme: n.userRoamingDataHome.scheme
		}), e.getChannel("userDataProfiles"));
		i.set(_a, m);
		const v = new XCo(Fk(this.a.profiles.profile, m.profilesHome.scheme));
		i.set(Pl, v), h.registerProvider(me.vscodeUserData, this.D(new KCo(me.file, g, me.vscodeUserData, m, p, a)));
		const y = new zIr;
		y.register(0, new tSo(null)), i.set(Vye, y);
		const w = this.D(new QCi(y, v, n, s, d, u, a));
		i.set(Ia, w), this.D(FCo.register(w, h, a));
		const C = this.m(n),
			[S, x] = await Promise.all([this.n(C, n, v, m, h, w, p, a, t).then(D => (i.set(Dt, D), i.set(rI, D), D)), this.q(C, n, v, m, e).then(D => (i.set(ft, D), D)), this.r(e).then(D => (i.set(_sn, D), D))]),
			k = new T9t(S, n);
		i.set(z3, k);
		const I = new P9t(S, d, x, p, n, S, k, h);
		return i.set(Dd, I), S.updateWorkspaceTrust(I.isWorkspaceTrusted()), this.D(I.onDidChangeTrust(() => S.updateWorkspaceTrust(I.isWorkspaceTrusted()))), {
			serviceCollection: i,
			logService: a,
			storageService: x,
			configurationService: S
		}
	}
	m(i) {
		return this.a.workspace ? this.a.workspace : NS(this.a.backupPath, i.isExtensionDevelopment)
	}
	async n(i, e, t, s, n, r, o, a, l) {
		const c = new OCo([me.file, me.vscodeUserData], e, n),
			u = new SCo({
				remoteAuthority: e.remoteAuthority,
				configurationCache: c
			}, e, t, s, n, r, o, a, l);
		try {
			return await u.initialize(i), u
		} catch (h) {
			return ls(h), u
		}
	}
	async q(i, e, t, s, n) {
		const r = new ECo(i, t, s, n, e);
		try {
			return await r.initialize(), r
		} catch (o) {
			return ls(o), r
		}
	}
	async r(i) {
		const e = new nSi(i);
		try {
			return await e.initialize(), e
		} catch (t) {
			return ls(t), e
		}
	}
};


http://www.kler.cn/a/574250.html

相关文章:

  • VS2019,VCPKG - 为VS2019添加VCPKG
  • 【启发式算法】Dijkstra算法详细介绍(Python)
  • 高频 SQL 50 题(基础版)| 高级字符串函数 / 正则表达式 / 子句:1667. 修复表中的名字
  • Jenkins工具配置与运用指南:从零到持续交付
  • 网络安全 三高三弱治理
  • 【进程和线程】(面试高频考点)
  • HTML第四节
  • Android Studio快速配置国内镜像源和HTTP代理
  • python基础课程整理--元组的基础
  • 分类预测 | Matlab实现PSO-BP-Adaboost基于粒子群算法优化BP神经网络结合Adaboost思想的分类预测模型
  • 同一个网段的IP可以自由访问吗?不同网段的IP必须通过公网IP访问吗?
  • 【鸿蒙操作系统】- 1:实习阶段的一些总结
  • 【项目】视频点播
  • PTA 7-6 列出连通集
  • 在MWC2025,读懂华为如何以行践言
  • 考研初试需要准备多少时间用于复习备考?
  • Hadoop、Hive、Spark的关系
  • RecyclerView与ListView的优化
  • Android Studio Gradle 8.0 适配指南
  • 在大型语言模型的提示词设计中,system、user和assistant三个角色的区别与联系