дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
feat(plugins): plugin system with extension points, consent, Wasm runtime and plugin API 1.0 (#971)
A plugin system built on WebAssembly components (wasmtime, WASI p2), with a typed WIT API (`openidea:[email protected]`) and a Rust SDK, shipped as a preview. - Extension points declared in `plugin.toml` (commands, languages, themes, icon themes, menus, key bindings, status items, settings, views, custom editors, file icons and templates, run detectors, editor providers), validated before anything takes effect and projected onto the workbench's own registries: plugin themes and file icon themes are chosen in Settings › Appearance and Quick Switch, plugin shortcuts are edited in Settings › Keymap, plugin problems are grouped in Settings › Inspections. - Capabilities with risk levels and consent at install, pinned `process:` programs, secrets in the OS keychain. - Runtime: one thread per active plugin, fuel/time/memory budgets, soft and hard deadlines on the editing path, cancellation, crash backoff, idle reclaim, a precompiled-component cache; remote projects run code plugins on `openidea-server`. - Web views and custom editors with a sandboxed page, a document bridge joined to the text editor's undo history, and split or preview layouts. - Distribution: signed `.oiplugin` packages, a static marketplace index with revocation, versioned installs with rollback, install from a `.zip` or a folder. The release workflow signs and publishes the official plugins and their index, which released builds use as the default marketplace. - Official plugins: String Tools, Key Promoter, Git Toolbox, AI Completion, Checkstyle, MyBatis Navigator, CSV Editor, Solidity, Material Icons, Harbor Night, Excalidraw, Graphviz, Regex Tester, License Header. Closes #732 Co-authored-by: Deng Liu <[email protected]> Co-authored-by: florentvdry <[email protected]>
Цей коміт міститься в:
450 files changed
+47018
-3058
No files matched your search
@@ -37,7 +37,9 @@ import {
|
||||
Tree,
|
||||
acquirePopup,
|
||||
fileIconName,
|
||||
useFileIconRevision,
|
||||
folderIconName,
|
||||
themedFolderIconName,
|
||||
showContextMenu,
|
||||
SymbolBadge,
|
||||
type DragSession,
|
||||
@@ -125,6 +127,7 @@ function iconFor(
|
||||
root: string | null,
|
||||
build: BuildPresentation,
|
||||
detected: readonly RootFolder[],
|
||||
expanded: boolean,
|
||||
): string {
|
||||
if (node.placeholder) return node.placeholder === "dir" ? "folder" : "file";
|
||||
if (node.icon) return node.icon;
|
||||
@@ -136,7 +139,7 @@ function iconFor(
|
||||
const key = rel !== null && build.modules.has(rel) ? rel : node.path;
|
||||
const module = root ? moduleFolderIcon(key, node.root, build.modules) : null;
|
||||
if (module) return module;
|
||||
return node.root ? "module" : "folder";
|
||||
return node.root ? "module" : (themedFolderIconName(node.label, expanded) ?? "folder");
|
||||
}
|
||||
return fileIconName(node.label);
|
||||
}
|
||||
@@ -267,15 +270,18 @@ const Row = memo(function Row({
|
||||
onDoubleClick,
|
||||
onPointerDown,
|
||||
}: RowProps) {
|
||||
// Memoised: redraw this row itself when the file icon theme changes.
|
||||
useFileIconRevision();
|
||||
const deco = useFileDecoration(node.path);
|
||||
const roots = useEffectiveRoots();
|
||||
const root = useProjectTree((s) => s.root);
|
||||
const detected = useDetectedRoots();
|
||||
const build = useProjectPresentation();
|
||||
const file = useJvmPresentation(node.dir || node.placeholder ? "" : node.path, node.entry?.mtimeMs);
|
||||
const expanded = useProjectTree((s) => node.dir && s.expanded.has(node.key));
|
||||
const icon =
|
||||
node.dir || node.placeholder || node.icon
|
||||
? iconFor(node, roots, root, build, detected)
|
||||
? iconFor(node, roots, root, build, detected, expanded)
|
||||
: presentationIcon(node.path, file, roots, root, build.spring);
|
||||
const moduleFolder =
|
||||
node.dir && !node.placeholder && !!root && isModuleFolder(relativePath(root, node.path), node.root, build.modules);
|
||||
@@ -396,6 +402,8 @@ function folderAt(container: HTMLElement | null, x: number, y: number): { key: s
|
||||
|
||||
export function ProjectView() {
|
||||
const txTemplate = useTxTemplate();
|
||||
// Rows compute their file icons while rendering: redraw when the icon theme changes.
|
||||
useFileIconRevision();
|
||||
const root = useProjectTree((s) => s.root);
|
||||
const model = useProjectTree(selectModel);
|
||||
const expanded = useProjectTree((s) => s.expanded);
|
||||
|
||||
Reference in new issue
Заблокувати користувача