The PR check now only asks for the How it was verified section. Linking an issue with Closes #<n> stays recommended when a PR resolves one.
7.0 KiB
OpenIDEA — contributor guide
Rust + Tauri 2 desktop IDE with full-featured, multi-language code intelligence.
Visual style: dark, low-contrast greys, one cool accent
(src/styles/tokens.css is the source of truth for colours and metrics).
Layout
crates/ide-*— backend crates; one domain each. Depend onide-corefor shared types; never reach into another crate's internals.src-tauri/— glue only:state.rs(AppState / Project),commands/<domain>.rs(thin typed IPC adapters),events.rs. No domain logic here.src/bindings.ts— generated by tauri-specta (pnpm gen:bindings). Never edit.src/platform/— ipc (call,onIdeEvent,nextRequestId), actions registry, keymap + dispatcher, context keys /whenclauses, project store.src/workbench/contributions.ts— extension points (tool windows, status items, overlays, editor kinds) and cross-feature services (editor, tool windows, notifications).src/ui/— design-system primitives.src/features/<name>/— one feature each, exportingactivate()registered insrc/features/index.ts.languages/<id>.toml— language definitions (detection, comments, LSP, DAP).crates/ide-host— theopenidea-serverbinary for remote development and theopenidea-pluginCLI (plugin starter templates live in itstemplates.rs).wit/— plugin interface definitions;plugins/— sample and bundled plugins. Plugin docs:plugins/README.md,docs/plugins/themes.md.java/— JDT LS extension bundles (java-usages,kotlin-bridge) and the patched Lombok agent, embedded into the app byide-sdk/ide-tools.e2e/— Playwright UI tests (pnpm e2e).fixtures/— sample projects per language for manual and automated testing.
Rules
- IPC coordinates: 0-based lines, UTF-16 columns/offsets everywhere (
ide-core::text). - Every command returns
IdeResult<T>; convert internal errors at the crate edge. - Streaming →
tauri::ipc::Channel<T>; cancellable → UI-allocatedRequestId+cancel_request. Backend → UI notifications →IdeEventviaEventSink. - Long work never blocks the UI thread or a Tauri command thread: use
spawn_blocking/rayon, honourCancellationToken. - Frontend features never import each other; communicate via actions, contributions
and services. All user-invocable behaviour is an action with a stable id; default
shortcuts live in
src/platform/keymaps/. - Styling: CSS Modules + tokens only (no hex literals in components). Inline SVG
icons from
src/ui/icons.tsx, never emoji. Real<button>/<input>;aria-labelon icon buttons. - User-visible text goes through the text catalog: add every new string to both
src/platform/locales/text/en.jsonandzh.json(textCatalog.test.tsenforces it). Other locales may lack entries; their UI shows the English text until a translator adds it. - Keep comments sparse and purposeful; match surrounding style.
- For GUI verification, prefer Tauri MCP; use Computer Use only when Tauri MCP is unavailable or cannot cover the required checks.
Issues & PRs
Follow CONTRIBUTING.md and .github/pull_request_template.md: one problem per PR
(Closes #<n> when it resolves an issue), reproduce first, keep the diff focused, short plain description, and a
How it was verified section with commands run, results and (for UI) before/after screenshots.
Unclear product decisions → needs-decision and stop.
Skills
Shared agent skills live in .agents/skills/ (.claude/skills/ links to them):
verify drives the running app through Tauri MCP and captures screenshot evidence;
issue-fix takes an issue from reproduction to one PR.
Commands
pnpm tauri dev— run the app with worktree isolation (Node 22.18+).pnpm dev:appalso enables the global Tauri API.pnpm dev:statusreports this worktree's running MCP bridges and actual ports.pnpm build— typecheck + bundle frontend.cargo nextest run --workspace(orcargo test),cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --all.pnpm test,pnpm e2e,pnpm lint,pnpm format:check,pnpm knip,pnpm typecheck,pnpm gen:bindings.pnpm perf(UI interaction latency / frames / leaks),pnpm perf:rust(criterion benches vs budgets). Budgets:perf/budgets.json.
Before opening a PR
Run what CI runs for the parts you touched:
- Rust:
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo nextest run --workspace. After changing IPC types, runpnpm gen:bindingsand commitsrc/bindings.ts; CI fails if it differs. - Frontend:
pnpm typecheck,pnpm lint,pnpm format:check,pnpm knip,pnpm test,pnpm build, andpnpm e2efor UI flows. - UI or runtime behaviour: verify in the running app (
.agents/skills/verify).
Pitfalls
- Run a subset of frontend tests with
pnpm vitest run <path>.pnpm test -- <path>ignores the filter and runs the whole suite, which takes several minutes. - Don't run clippy while iterating:
pnpm tauri devcompiles anyway. Runcargo fmt --all+cargo clippy -p <crate> --all-targets -- -D warningsonce, right before committing. A cold build cache can take around 5 minutes. Run long checks one at a time, not chained in one shell call that may hit the 10-minute tool timeout. pnpm tauri devdoes a full debug build. Clippy only checks the code, so a passing clippy doesn't make the first launch fast.
Parallel worktrees
Several worktrees can be developed and run side by side.
- Create one per task:
git worktree add ../<name> -b <branch> origin/main, thenpnpm installin it. - Launch with
pnpm tauri dev/pnpm dev:app, not the rawpnpm exec tauri devCLI. The wrapper starts Vite on a worktree-derived port (advancing if occupied), passes its actual URL to Tauri, and reports an existing launcher instead of starting another for the same worktree. HMR uses the Vite port. - Debug app identity, data, settings, logs and single-instance scope follow the canonical
worktree path captured at build time, independent of launch cwd. Launching the same debug
binary again focuses its existing instance and forwards its path argument. Different
worktrees and the installed release can coexist.
--releaseuses normal release identity and bypasses the development wrapper. - MCP bridge ports are dynamic (9223–9322). Use
pnpm dev:status, connect to the reported port, verify identifier/cwd, and passappIdentifier: <port>explicitly. Do not assume the default MCP session belongs to this worktree. - Keep each worktree's Cargo output directory separate; do not point
CARGO_TARGET_DIRortargetsymlinks at a shared directory. - Each worktree's first build is cold (around 5 minutes) and its Cargo output takes 15–30 GB. Avoid running several heavy builds on one machine at the same time.
- Stop only processes started for the current worktree/session. Never use broad
process-name kills such as
pkill openidea. - When done: stop that worktree's app and dev session, delete its build output, then
git worktree remove ../<name>.