Файли
openidea/src/cloneWindowBoot.ts
T
arookieofc-ai[bot]таarookieofc-ai 67c00a986a feat(plugins): add clone sources to the Clone Repository dialog (#7948)
[[contributes.cloneSources]] (API 1.21) adds an entry to the Get from VCS source list whose required web page lists repositories and hands the chosen one to the dialog with {"op": "clone-url", "url": …}. The page is served and messaged like other plugin web UI under the key cloneSources/<id>; the dialog fills its URL and directory and git only runs what the user confirms. The standalone Get from VCS window registers only this contribution point. plugin_web_page and plugin_view_event now also run in projectless windows (outside_restricted); Restricted Mode still runs no plugin UI or code. Docs list the point under API 1.21.

Fixes #5572

Co-authored-by: arookieofc-ai <[email protected]>
2026-12-04 20:46:11 +08:00

34 рядки
1.5 KiB
TypeScript

import type { ComponentType } from "react";
import { installLocaleSync } from "./features/app/locale";
import { githubCloneSource } from "./features/github/clone/source";
import { startCloneSourcePlugins } from "./features/plugins/cloneSource";
import { trackRuntimeSettings } from "./features/settings/runtime";
import { activateCloneLaunches, CloneWindow } from "./features/vcs/cloneWindow";
import { provideEmbeddedTerminal, registerCloneSource } from "./workbench/contributions";
import { activateDialogWindow } from "./workbench/dialogWindow";
import { activateList } from "./windowBoot";
/** The embedded terminal of the GitHub Sign In dialog, loaded on first use. */
function embeddedTerminal(): () => void {
provideEmbeddedTerminal(async (host, options) =>
(await import("./features/terminal/loader"))
.loadTerminalRuntime()
.then((rt) => rt.createEmbeddedTerminal(host, options)),
);
return () => provideEmbeddedTerminal(undefined);
}
/** Get from VCS window of project window `parent`: the clone dialog and its sources, no workbench. */
export function bootCloneWindow(parent: string): ComponentType {
activateList("clone window", [
["locale", installLocaleSync],
["settings", trackRuntimeSettings],
["terminal", embeddedTerminal],
["github", () => registerCloneSource(githubCloneSource)],
["plugin clone sources", startCloneSourcePlugins],
["dialog", () => activateDialogWindow(parent)],
["launch", activateCloneLaunches],
]);
return CloneWindow;
}