дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-03 16:51:16 +02:00
Plugin API 1.4: grants for unencrypted HTTP, local sockets, IDE commands and owned database sources; window status items, output channels, content tabs, editor selections, decorations, search, Problems and VCS reads; runs, keyed terminals with exit events, plugin run targets, dynamic run configurations and test parsers; language features, injections, snippets and menu locations; plugin MCP tools on the built-in server; four official API examples. Released 1.3 plugins keep working.
27 рядки
847 B
TypeScript
27 рядки
847 B
TypeScript
import { useActions } from "@/platform/actions";
|
|
/** Plugin action slots in existing editor and main toolbars. */
|
|
import { useContextKeys, evaluateWhen } from "@/platform/context";
|
|
import { IconButton } from "@/ui";
|
|
import { useMenuSlotItems } from "./contributions";
|
|
export function ContributedToolbar({ slot }: { slot: string }) {
|
|
const actions = useActions((s) => s.actions);
|
|
const items = useMenuSlotItems((s) => s.slots[slot]);
|
|
useContextKeys();
|
|
return (
|
|
<>
|
|
{(items ?? [])
|
|
.filter((i) => evaluateWhen(i.when ?? undefined))
|
|
.map((i) => (
|
|
<IconButton
|
|
key={i.action}
|
|
icon={actions.get(i.action)?.icon ?? i.icon ?? "plugin"}
|
|
action={i.action}
|
|
actionArg={i.arg}
|
|
title={i.label}
|
|
size="small"
|
|
/>
|
|
))}
|
|
</>
|
|
);
|
|
}
|