From 805d588303e6ce985b7825ee8b7ef06cdb77fd4d Mon Sep 17 00:00:00 2001
From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
Date: Tue, 10 Nov 2026 16:13:06 +0800
Subject: [PATCH] docs: move plugin docs next to plugins/README.md
docs/plugins/themes.md and indexing.md move to plugins/. Update the
theme doc generator, its test, the plugin template, AGENTS.md and every
link to the new paths.
---
.oxfmtrc.json | 2 +-
AGENTS.md | 2 +-
crates/ide-host/src/bin/openidea-plugin/templates.rs | 2 +-
plugins/README.md | 6 +++---
{docs/plugins => plugins}/indexing.md | 0
plugins/official/harbor-night/README.md | 2 +-
.../official/harbor-night/themes/harbor-night.theme.json | 2 +-
{docs/plugins => plugins}/themes.md | 8 ++++----
scripts/theme/gen-docs.ts | 4 ++--
scripts/theme/import-intellij-theme.ts | 2 +-
scripts/theme/theme.test.ts | 4 ++--
scripts/theme/tokens.ts | 2 +-
sdk/rust/openidea-plugin/README.md | 2 +-
13 files changed, 19 insertions(+), 19 deletions(-)
rename {docs/plugins => plugins}/indexing.md (100%)
rename {docs/plugins => plugins}/themes.md (99%)
diff --git a/.oxfmtrc.json b/.oxfmtrc.json
index 10806cab46..4fe4076aaf 100644
--- a/.oxfmtrc.json
+++ b/.oxfmtrc.json
@@ -12,7 +12,7 @@
"src/editor/core/cm/angular/parser*.ts",
"src/editor/core/cm/jsp/parser*.ts",
"src/editor/core/cm/astro/parser*.ts",
- "docs/plugins/themes.md",
+ "plugins/themes.md",
"pnpm-lock.yaml",
"**/*.toml",
"fixtures",
diff --git a/AGENTS.md b/AGENTS.md
index 202c8be365..e39f1e6bc4 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -21,7 +21,7 @@ Visual style: dark, low-contrast greys, one cool accent
- `crates/ide-host` — the `openidea-server` binary for remote development and the
`openidea-plugin` CLI (plugin starter templates live in its `templates.rs`).
- `wit/` — plugin interface definitions; `plugins/` — sample and bundled plugins.
- Plugin docs: `plugins/README.md`, `docs/plugins/themes.md`.
+ Plugin docs: `plugins/README.md`, `plugins/themes.md`.
- `java/` — JDT LS extension bundles (`java-usages`, `kotlin-bridge`) and the patched
Lombok agent, embedded into the app by `ide-sdk` / `ide-tools`.
- `e2e/` — Playwright UI tests (`pnpm e2e`). `fixtures/` — sample projects per language
diff --git a/crates/ide-host/src/bin/openidea-plugin/templates.rs b/crates/ide-host/src/bin/openidea-plugin/templates.rs
index 44613eeaae..63fcd888c7 100644
--- a/crates/ide-host/src/bin/openidea-plugin/templates.rs
+++ b/crates/ide-host/src/bin/openidea-plugin/templates.rs
@@ -208,7 +208,7 @@ authors = []
engines.openidea = "^1.0"
# One entry per theme. `editor-scheme` is optional: its tokens are merged over
-# the theme's (IntelliJ's .theme.json + .icls pair). Reference: docs/plugins/themes.md.
+# the theme's (IntelliJ's .theme.json + .icls pair). Reference: plugins/themes.md.
[[contributes.themes]]
path = "themes/__SLUG__.theme.json"
editor-scheme = "themes/__SLUG__.scheme.json"
diff --git a/plugins/README.md b/plugins/README.md
index 61cea570fd..dc32df98cd 100644
--- a/plugins/README.md
+++ b/plugins/README.md
@@ -251,7 +251,7 @@ its component with `plugins/build.sh crates/ide-plugin/tests/fixtures/file-templ
`[[contributes.documentIndexers]]` declares file `extensions` and requires the optional
`document-indexer` export. It publishes cross-file associations (definitions, references,
aliases and gutter markers) in background batches, not on the editing path. See
-[Background document indexers](../docs/plugins/indexing.md).
+[Background document indexers](indexing.md).
API 1.3 also uses this graph for Find Usages and Rename on published definitions
and references, alongside language-server results. Name anchors must cover exactly
@@ -1957,7 +1957,7 @@ colours, merged over the theme). Pick a theme in Settings › Plugins › _Apply
Start with `openidea-plugin new
--template theme` (or a copy of
[`official/harbor-night`](official/harbor-night)); the full guide, token
reference and IntelliJ / VS Code porting tables are in
-[`docs/plugins/themes.md`](../docs/plugins/themes.md).
+[`plugins/themes.md`](themes.md).
## 5. File icon themes
@@ -2134,7 +2134,7 @@ granted, and starts the approved program.
the package at its root or in its only folder, or a folder's `plugin.toml`;
a zip without a `plugin.toml` there, such as an IntelliJ plugin, is refused; IntelliJ
theme plugins are imported instead: _Import IntelliJ Theme from File…_ and _Import Theme
- from JetBrains IDE…_, see [`docs/plugins/themes.md`](../docs/plugins/themes.md)). The install
+ from JetBrains IDE…_, see [`plugins/themes.md`](themes.md)). The install
page lists every capability and whether the package is signed by a publisher
the marketplace trusts; nothing is copied until you accept.
- **Versions:** installed plugins live in `/plugins///`
diff --git a/docs/plugins/indexing.md b/plugins/indexing.md
similarity index 100%
rename from docs/plugins/indexing.md
rename to plugins/indexing.md
diff --git a/plugins/official/harbor-night/README.md b/plugins/official/harbor-night/README.md
index 34eaa5e86b..7e3461941d 100644
--- a/plugins/official/harbor-night/README.md
+++ b/plugins/official/harbor-night/README.md
@@ -4,7 +4,7 @@ An OpenIDEA theme plugin, **Harbor Night**: a dark theme with slate surfaces, a
teal accent and a warm syntax palette. It is also where new themes start:
`openidea-plugin new --template theme` copies its theme files, or copy this
folder. Full documentation, the token reference and porting guides are in
-[`docs/plugins/themes.md`](../../../docs/plugins/themes.md).
+[`plugins/themes.md`](../../themes.md).
```
harbor-night/
diff --git a/plugins/official/harbor-night/themes/harbor-night.theme.json b/plugins/official/harbor-night/themes/harbor-night.theme.json
index 821c931d90..3046737648 100644
--- a/plugins/official/harbor-night/themes/harbor-night.theme.json
+++ b/plugins/official/harbor-night/themes/harbor-night.theme.json
@@ -1,7 +1,7 @@
// Harbor Night: UI theme. Keys are the CSS variables of src/styles/tokens.css,
// grouped like its Islands Light block. Delete a line to keep the built-in value
// of the base named by "kind". Comments are allowed (// and /* */).
-// Full reference: docs/plugins/themes.md.
+// Full reference: plugins/themes.md.
{
"id": "harbor-night",
"name": "Harbor Night",
diff --git a/docs/plugins/themes.md b/plugins/themes.md
similarity index 99%
rename from docs/plugins/themes.md
rename to plugins/themes.md
index f2d3faf8e8..d13a47f788 100644
--- a/docs/plugins/themes.md
+++ b/plugins/themes.md
@@ -18,7 +18,7 @@ my-theme/
```
The quickest way to start is `openidea-plugin new --template theme`, or a copy of
-[`plugins/official/harbor-night`](../../plugins/official/harbor-night).
+[`plugins/official/harbor-night`](official/harbor-night).
It contains *Harbor Night*, a complete example dark theme that sets every
themeable token. The rest of this page covers the file format, the token
reference, porting themes from IntelliJ IDEA and VS Code, and testing.
@@ -39,7 +39,7 @@ editor-scheme = "themes/harbor-night.scheme.json" # optional
```
Paths are relative to the package directory and may not leave it. The other
-manifest fields are described in [`plugins/README.md`](../../plugins/README.md).
+manifest fields are described in [`plugins/README.md`](README.md).
## The theme file
@@ -55,7 +55,7 @@ manifest fields are described in [`plugins/README.md`](../../plugins/README.md).
}
```
-- **`tokens`** are the CSS variables of [`src/styles/tokens.css`](../../src/styles/tokens.css),
+- **`tokens`** are the CSS variables of [`src/styles/tokens.css`](../src/styles/tokens.css),
the IDE's single source of colours. Components never use colour literals, so
every surface, border, text colour, syntax colour and status colour can be
themed through them. The [reference](#token-reference) lists them all.
@@ -206,7 +206,7 @@ ship no `.icls` at all keep the built-in syntax colours.
| `--bg-toggle-*` | `ToggleButton.onBackground`, `.offBackground`, `.buttonColor` |
| `--bg-feedback-*`, `--border-feedback-*` | `Banner.infoBackground`, `Banner.errorBorderColor`, … |
-The full table is `UI_KEYS` in [`src/features/plugins/intellijTheme.ts`](../../src/features/plugins/intellijTheme.ts).
+The full table is `UI_KEYS` in [`src/features/plugins/intellijTheme.ts`](../src/features/plugins/intellijTheme.ts).
#### `.icls` → editor scheme
diff --git a/scripts/theme/gen-docs.ts b/scripts/theme/gen-docs.ts
index 46269309fc..39d372bed0 100644
--- a/scripts/theme/gen-docs.ts
+++ b/scripts/theme/gen-docs.ts
@@ -1,12 +1,12 @@
/**
- * Regenerates the token reference in docs/plugins/themes.md from
+ * Regenerates the token reference in plugins/themes.md from
* src/styles/tokens.css (`pnpm gen:theme-docs`). scripts/theme/theme.test.ts
* fails when the checked-in reference is stale.
*/
import { readFileSync, writeFileSync } from "node:fs";
import { referenceMarkdown, themeTokenGroups, withReference } from "./tokens.ts";
-const DOC = "docs/plugins/themes.md";
+const DOC = "plugins/themes.md";
const groups = themeTokenGroups(readFileSync("src/styles/tokens.css", "utf8"));
const doc = readFileSync(DOC, "utf8");
const next = withReference(doc, referenceMarkdown(groups));
diff --git a/scripts/theme/import-intellij-theme.ts b/scripts/theme/import-intellij-theme.ts
index d294c1ce5d..66550d38a8 100644
--- a/scripts/theme/import-intellij-theme.ts
+++ b/scripts/theme/import-intellij-theme.ts
@@ -59,5 +59,5 @@ if (scheme) {
console.log(
`${theme.name} (${theme.kind}): ${Object.keys(theme.tokens).length} UI tokens` +
(scheme ? `, ${Object.keys(scheme.tokens).length} editor tokens` : "") +
- ` → ${values.out}\nUnmapped tokens keep the built-in ${theme.kind} values; see docs/plugins/themes.md to fill them in.`,
+ ` → ${values.out}\nUnmapped tokens keep the built-in ${theme.kind} values; see plugins/themes.md to fill them in.`,
);
diff --git a/scripts/theme/theme.test.ts b/scripts/theme/theme.test.ts
index afdbecd5a1..6c7cbceece 100644
--- a/scripts/theme/theme.test.ts
+++ b/scripts/theme/theme.test.ts
@@ -40,8 +40,8 @@ describe("theme token reference", () => {
expect(() => themeTokenGroups(bad)).toThrow(/--b .*section comment/);
});
- it("is current in docs/plugins/themes.md (run pnpm gen:theme-docs)", () => {
- const doc = read("docs/plugins/themes.md");
+ it("is current in plugins/themes.md (run pnpm gen:theme-docs)", () => {
+ const doc = read("plugins/themes.md");
expect(withReference(doc, referenceMarkdown(groups))).toBe(doc);
});
});
diff --git a/scripts/theme/tokens.ts b/scripts/theme/tokens.ts
index 58c773f4ed..9404943e6b 100644
--- a/scripts/theme/tokens.ts
+++ b/scripts/theme/tokens.ts
@@ -131,7 +131,7 @@ export function tokenSets(groups: readonly TokenGroup[]): { ui: string[]; scheme
const cell = (v: string) => "`" + v.replace(/\|/g, "\\|") + "`";
const capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
-/** Markdown token reference (one table per group) for docs/plugins/themes.md. */
+/** Markdown token reference (one table per group) for plugins/themes.md. */
export function referenceMarkdown(groups: readonly TokenGroup[]): string {
const { ui, scheme } = tokenSets(groups);
const parts = [
diff --git a/sdk/rust/openidea-plugin/README.md b/sdk/rust/openidea-plugin/README.md
index 28b4013374..37f0c66922 100644
--- a/sdk/rust/openidea-plugin/README.md
+++ b/sdk/rust/openidea-plugin/README.md
@@ -33,7 +33,7 @@ and references. Existing indexers work without another export; declare
cover exactly the name, using UTF-16 columns. The host merges native results,
previews indexed renames and applies them as one undoable workspace edit.
The existing `project.read` capability and trusted-project boundary apply.
-See [the indexing contract](../../../docs/plugins/indexing.md#find-usages-and-rename-api-13)
+See [the indexing contract](../../../plugins/indexing.md#find-usages-and-rename-api-13)
and [the minimal fixture](../../../crates/ide-plugin/tests/fixtures/indexer).
API 1.3 also adds diagnostics for unsaved documents. Declare