Matches in the Find in Files and Search Everywhere preview use the editor scheme's search result background (IntelliJ's SEARCH_RESULT_ATTRIBUTES, new token --bg-search-result with values for every built-in theme) instead of the lists' SearchMatch yellow, as a background only so syntax colours stay readable. SEARCH_RESULT_ATTRIBUTES now imports into the new token; --bg-search-match keeps coming from SearchMatch.
Closes#2858
Co-authored-by: formiat <29867335+formiat@users.noreply.github.com>
The WebSocket and document-subscription APIs changed wit/ and the SDK, so the checked-in components no longer matched their source fingerprints; this rebuilds all 43.
Plugins can subscribe to committed local edits of open project documents with subscribe-paths("document-changed", globs) and receive versioned UTF-16 replacements. editor.document-at and editor.apply-edits-at read and edit an explicitly named open project document from background events; stale versions are rejected without changing the editor, and these edits are non-undoable and not re-emitted as local changes.
document-changed is delivered only for named paths and only to plugins granted project.read and editor.read. Also delivers websocket-ready events to plugins from the frontend runtime. API 1.6.
Co-authored-by: SorPuti <56741582+SorPuti@users.noreply.github.com>
The Python color tokens from the Python color page were missing from the Harbor Night template and plugins/themes.md; the maximized-notifications update tests maximized a side with no tool window, which #2830 treats as stale.
A call that starts a tasks progress handle gets the background wall-clock budget (60 s, renewed on report), but its Wasm fuel stayed at the per-call foreground budget, so long background work trapped with OutOfFuel. Background calls now get fuel scaled by background/timeout, refilled when tasks.begin, task.report and task.is-cancelled return (fuel is only reloaded by compiled code across host calls); every new call is re-armed with the normal budget, and OutOfFuel reports the budget that was active.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
Plugins get a host-owned WebSocket resource (net.websocket-connect → websocket with id/send/drain/close; dropping it closes the transport). The connection is bound to the project it was opened for, needs the endpoint's net:<host> grant, uses WSS outside loopback with the shared rustls config, and is capped at eight per plugin. Request headers (secret placeholders expanded) go with the handshake, except the ones the handshake owns; an empty subprotocol requests none; the handshake is bounded by the call's I/O budget. Incoming frames queue in a bounded FIFO, signalled by the websocket-ready event. Checked-in components are rebuilt for API 1.6.
Co-authored-by: SorPuti <56741582+SorPuti@users.noreply.github.com>
process.run kept at most 4 MiB of stdout and silently dropped the rest while reporting success, so large structured output (kubectl -o json, cargo metadata) reached plugins cut off mid-document. The limit is now 16 MiB, as for file reads, and stdout beyond it fails the call with an explicit error instead of returning truncated output. stderr is still truncated without failing.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
- Restricted Mode git: reads run without a signature verifier, hooks
(including config-defined ones), an external diff, filters or a lazy
fetch, also inside submodules; every repository and every git starts
restricted until the project is trusted.
- project.write and plugin quick fixes cannot reach git's own files under
any spelling or through links; project.write is a high-risk grant.
- Built-in web server: each served root has its own port and token; a
file outside the project is served with its folder minus dot names, or
alone when that folder is the home folder or above it; no fixed port.
- Images, references, Markdown links and language-server links reach no
network share other than the one already open.
- Marketplace: entries whose id or version no manifest may carry are
dropped; an index read over the network names nothing on this machine;
network reads are bounded in size and time.
- Agent replies load remote images on a click; the Markdown preview and
Mermaid configuration no longer fetch from other hosts.
Languages & Frameworks had a standalone Plugin Formatters page that, with no
plugin providing a formatter, only showed a Format on save toggle duplicating
Tools > Actions on Save and Editor > General. The per-language plugin
formatter choice now lives in Editor > Code Style > Formatter, appears only
when an enabled plugin provides a formatter, and follows the Code Style
scheme (Copy to Project / Copy to IDE include it). Docs and the plugin README
point to the new location.
Plugins could not rely on each other: nothing said "this plugin needs that one", and a plugin had no way to let others extend it. Plugin API 1.5 adds both.
- `[[depends]]` in `plugin.toml` (version range, `optional`). A plugin whose required dependency is missing, disabled, the wrong version, cyclic or unable to run is shown as Blocked with the reason and starts once the dependency can run again. Plugins start in dependency order; disabling a plugin others need asks first. Granting or revoking a dependency's permissions also settles its dependents.
- `[[extension-points]]` declares points with typed fields. Dependents contribute to them from `plugin.toml` (checked at install time); the owner reads them through the read-only `extensions` interface (`host::extension_contributions`) and hears changes through the `extensions-changed` event.
The plugin details page shows what a plugin requires, who requires it, and its extension points with their contributors. Covered by the `ext-owner` fixture and `plugin_dependencies.rs`.
Co-authored-by: ntbang0901 <121003585+ntbang0901@users.noreply.github.com>
`read-file` returns UTF-8 text only, so a plugin could not read a PDF, image, archive or font inside the open project, and `fs.read-bytes` needs a per-path grant. `workspace.project` gains `read-bytes(path)` with `read-file`'s rules (`project.read`, `resolve_in_root` confinement, `not-found` for missing paths, 16 MiB cap; always the file on disk). The Rust SDK exposes `Project::read_bytes` and the mock host `add_file_bytes`. Web custom editors get `document.bytes()` (at most 64 MiB, read-only).
Fixes#2347
Co-authored-by: Inf1mum <8135225+Inf1mum@users.noreply.github.com>
Settings › Editor › General › Appearance › Rainbow indent guides (off by default, under Show indent guides): guide N is drawn in --syn-rainbow-((N-1) mod 5 + 1), so each level of a deep block has its own colour. With the per-guide strips this only swaps the image each guide uses (--openidea-guide-1…5 from theme.ts), so theme and scheme switches recolour open editors through CSS; code lens rows follow the setting.
Closes#1560
Co-authored-by: mansur-akhmadi <10739460+mansur-akhmadi@users.noreply.github.com>
Java → XML lookups read every XML file in the project to find the namespace; with hundreds of XML files that ran past the provider's 500 ms budget, so no gutter markers appeared and repeated timeouts disabled the plugin. The lookup now searches for namespace="…" with the host's text search and reads only the matching files, cached per namespace for 30 s. The plugin requires engine ^1.4 (0.4.1).
Fixes#2505
* feat(mybatis): navigate and complete @ResultMap ids (#2461)
@ResultMap on a method jumps to @Results(id) in the same file, else to
the XML <resultMap>; resultMap= on XML statements jumps to <resultMap>;
all three get gutter markers and @ResultMap( completes ids (annotation
ids plus XML ids, merged). Unterminated strings now end at the newline
and interface-level ; resyncs paren tracking, so typing half-written
annotations no longer swallows the rest of the file.
* chore(mybatis): retrigger CI after retargeting to main
* fix(java): 重启后外部改动不增量编译导致 NoClassDefFoundError (#2527)
* feat(scheme): support a selection foreground colour (#2446)
Settings › Editor › Color Scheme › General › Editor gains a
Selection foreground attribute next to Selection background, wired
to a new --fg-editor-selection token. The editor paints selected
text with it (.cm-openidea-selected, including the diff viewer);
unset it keeps the previous rendering, with syntax colours showing
through (token default: inherit). .icls import/export round trips
it via SELECTION_FOREGROUND.
* test(themes): palette themes inherit selection foreground from base
Solarized/One keep the base default (preserve syntax colours on
selection); record that intent in INHERITED_FROM_BASE.
* fix(java): re-stamp mtime-preserving external edits before launch builds
Launch fingerprints detect external edits via content hash, but the Maven
rebuild that triggers is timestamp-incremental: sources whose mtime did not
advance are skipped, so the rebuild compiles nothing and the stale snapshot
is re-recorded as fresh. After an IDE restart the launch then reuses those
stale classes (NoClassDefFoundError).
Session::build now diffs the stored fingerprint against the fresh one,
re-stamps (bumps mtime on) sources whose content changed while
(length, mtime) stayed the same, and re-scans before building, so the
rebuild actually recompiles them and the record written afterwards matches.
Related to #2476
* feat(mybatis): navigate and complete #{} in annotation SQL (#2461)
Annotation @Select/@Insert/@Update/@Delete SQL strings now resolve
Definition, and complete parameter names after #{. Works without
any XML (pure-annotation mappers). Also fixes parse_java splitting
statements on braces/semicolons inside string literals.
* feat(mybatis): silence clippy type-complexity with LitSpan alias
* feat(scheme): support a selection foreground colour (#2446)
Settings › Editor › Color Scheme › General › Editor gains a
Selection foreground attribute next to Selection background, wired
to a new --fg-editor-selection token. The editor paints selected
text with it (.cm-openidea-selected, including the diff viewer);
unset it keeps the previous rendering, with syntax colours showing
through (token default: inherit). .icls import/export round trips
it via SELECTION_FOREGROUND.
* test(themes): palette themes inherit selection foreground from base
Solarized/One keep the base default (preserve syntax colours on
selection); record that intent in INHERITED_FROM_BASE.
Mapper XML gains Go to Definition and gutter markers for
<mapper namespace> (the interface), resultMap=/extends= (resultMap
ids, namespace-qualified or same-file) and <include refid=>
(<sql> ids, with refid completion). Links resolve even when the
interface is missing; unresolvable refs link nowhere.
This covers the XML-side navigation of #2461; annotation SQL,
OGNL, type aliases and Java type refs remain open.
* docs: remove unreferenced user guides
Drop docs/command-line.md, databases.md, java.md, unity-external-editor.md
and docs/media/debug.jpg. Nothing in the repository links to them.
Plugin, theme and README assets under docs/ stay.
* docs: keep only plugin docs under docs/
Remove docs/themes.md and docs/data-directories.md. Move the upstream
Atom One source revisions into THIRD_PARTY_LICENSES.md, drop the links
to the removed page, and move the README's WeChat QR code to
.github/assets/.
* 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.
Plugin run targets keep running programs, tests and package scripts inside
the target. Language servers and debuggers run on the host again:
- Remove the Language server targets settings page, the project-only
`languageServerTargets` setting and the PHP / Node.js "Language server:
run in target" option.
- Remove debugging through plugin targets; Debug on a plugin target is
refused again. PHP Remote Debug and Python remote configurations with a
path mapping debug programs in containers.
- Remove LSP / DAP message path mapping, read-only container documents and
the `ide-core` path-mapping module that only these used.
- Run-target validation (API 1.5, unreleased) no longer has a `debug`
operation, and debug start no longer takes a request id.
Plugins that declare net:ask can reach an HTTPS or loopback host their manifest does not list after the user allows it: Allow once, Always allow (remembered in the grant ledger, revocable in Settings › Plugins) or Deny. Unattended calls never prompt and are denied until the host is allowed. In remote development the dialog offers Allow for this session instead; the approval stays in memory on the server and ends with the connection, so no grant exists that the desktop cannot list or revoke.
Closes#2165
Co-authored-by: Inf1mum <8135225+Inf1mum@users.noreply.github.com>
The Excalidraw editor now lives in its own repository as the community plugin dengliu.excalidraw (listed in l0ng-ai/openidea-plugins, 0.2.0 adds .excalidraw.svg support and the official icons), so the example copy under plugins/official is removed. Its host test coverage for web-view editors, templates and file icons moves to the remaining examples, and plugins/README.md points to the community plugin. Installed copies of the old example keep working until uninstalled; installing dengliu.excalidraw from the marketplace replaces it.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
Closes#2408
Plugin run targets were static argv wrappers: a plugin couldn't refuse a built-in Run/Test/Debug launch through its target (for example when its container project is stopped), so the wrapper started and could start the environment as a side effect. API 1.5 adds an optional run-target-validation export: after trust, ownership, process-grant and pin checks the host calls validate with the operation, bare program name and working directory; an error refuses the launch with the plugin's (prefixed, bounded) message and keeps the selected target. Plugins without the export behave as before. Calls wake reclaimed instances, use the host call timeout, are cancelled with the launch, and fail closed on trap/timeout; for remote projects validation runs on the server. SDK helpers, plugins/README.md and fixtures updated.
Closes#2407
A run-target command override replaced the wrapper's args but always appended the target's shared workdir-args, so an override like `composer -> [composer]` for DDEV produced `ddev composer --dir=... -- install` and fed exec flags to Composer. API 1.5 adds register-with-overrides, whose command overrides carry optional workdir-args: none inherits the shared list, an empty list omits it, and a list replaces it with the same {cwd} mapping and argv/path bounds. API 1.4 registrations map onto it unchanged; trust, process grants, pinning, remote execution and debugging go through the same path. SDK, plugins/README.md and fixtures updated.
Python docstrings were highlighted as one flat token, so :param x:, .. note::, @param, Google Args: and NumPy Parameters sections looked like the prose around them. Adds an editor.docstringFormat setting (plain, rest, epytext, google, numpy; default rest) on Languages & Frameworks › Python Interpreter, and the Python highlighter now marks tags and keywords inside docstrings only (first statement of a module, class or function; not other or byte strings), with new Docstring › Tag and Docstring › Keyword colour-scheme attributes wired through the colour scheme, ICLS import, IntelliJ theme import and editor theme tokens.
Co-authored-by: muutot <92625353+muutot@users.noreply.github.com>
- Add ui.notify-project: it shows only in that project's window (the most recently focused one if there are several) and works without a calling window
- Button commands run in the window showing the notification; a closed project returns not-found, with nothing shown and no fallback to another window
- Bump the plugin API to 1.5.0 (wit/, SDK copy, ENGINE_VERSION, API_VERSION) and rebuild all components
- Add Project::notify and its mock to the SDK; update plugins/README.md
Co-authored-by: LU XIANGRUI <26499420+wildcatDownstairs@users.noreply.github.com>
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.
Tags inside doc comments looked like the rest of the comment text. They now get their own colours in Java, Kotlin, JavaScript, TypeScript, JSX, TSX and PHP: block and inline tags, tag values such as a `@param` name, KDoc links, and HTML markup from a fixed element list. Plain comments, strings and an `@` inside text get nothing. Colours come from new theme tokens, with entries under Settings > Editor > Color Scheme, in every built-in theme, and through .icls and IntelliJ theme import.
Only comment nodes in the visible ranges are scanned. The Kotlin tokenizer records doc comment state in its parser state, so long comments stay fast and correct.
Co-authored-by: lleviathe <95321986+lleviathe@users.noreply.github.com>
Indexed markers (Edges.markers) were always drawn with the navigation glyph,
so a plugin couldn't tell its marker kinds apart. A [[contributes.markerIcons]]
entry can now claim them by key prefix (`markers`), with an optional
`tooltip` shown above the targets. The host matches the longest prefix and
sends the declaration id with each marker; the editor resolves the icon and
the translated tooltip from the projected declaration. Manifest only, under
the existing API 1.3 gate of markerIcons.
Closes#2194
Plugin tool windows could only target the primary split of their dock, because the view was never registered as secondary. An optional secondary = true on [[contributes.views]], gated to plugin API 1.3, places a view in Left Bottom, Right Bottom or Bottom Right. Existing plugins stay where they are, and a user's saved layout wins.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
Sidebar buttons used a larger radius than the rest of the IDE, and their tooltips opened below the button, often over neighbouring stripe buttons.
Stripe buttons now use a 6px radius, and their tooltips open toward the inside of the window, with a dark background in light themes.
Siblings covered: every theme and plugin theme falls back to its base tooltip tokens, long tooltips flip correctly at the window edge, the shortcut hint stays readable, and the More button gets the same tooltip.
Co-authored-by: PLZY <41029728+PLZY@users.noreply.github.com>
Semantic tokens ignored the background, weight, italic and effect set for them in Color Scheme; only syntax tokens honoured them. Semantic roles now use the same attributes as syntax tokens, package references get their own attribute and theme token, and modifier styles keep winning over role styles, including deprecated static fields.
Default rendering changes: semantic constants are italic, as Color Scheme already declared, and package references in the light theme use the editor text colour.
Siblings covered: find matches stay above token backgrounds, and Package reference has a preview sample in Color Scheme.
Co-authored-by: shohruh-genius <7658451+shohruh-genius@users.noreply.github.com>
views.open-log-tab(key, title, process-log) (SDK host::open_log_tab) opens the read-only log tab a web view opens with open-log-tab, from a command or event of a window, reusing the Services pane's process-log.
The host checks the process grant and limits when called and remembers what each key runs in that window; the tab starts it by key (plugin_log_tab_spawn) through the web-view PTY checks: pinned program, trusted project, session cap, lifecycle and grant revocation. Remote windows report that these tabs aren't available there yet.
- workspace.symbols becomes the project method project.symbols(query, limit), like find-files; the Rust SDK's Project::symbols is unchanged, components built against the previous main need a rebuild.
- The open-log-tab web message names its arguments args, as pty-spawn and the services process-log do; baseArgs is refused with log-error rather than ignored.
- Document the hover, semantic-tokens and diagnostics provider exports and their worlds.
Closes#1720
Plugins can declare searchable multi-page settings (API 1.3): pages under the plugin in Settings, groups, string lists, editable tables and command buttons, while single-schema plugins keep working. A command button applies pending edits first and runs against the selected Global/Project layer (also remotely); Reset keeps other pages' edits, and invalid table/list edits never replace saved rows. Field and page order come from the schema without changing serde_json's map ordering elsewhere in the app.
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>
Related #1947
Uninstall keeps a plugin registered but stopped until its private data, secrets and package are cleaned up; a failure is shown and Uninstall can be retried, also after a restart (a durable cleanup record outside the package restores the target). While cleanup is pending, enable, reload, consent, permission changes, reinstall, replacement and rollback are refused. Secret-deletion errors are reported, and cleanup never follows a symlinked ancestor outside plugin storage. The SDK mock checks private-path components and rejects traversal independently of filesystem grants.
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>
A plugin web view can open an editor tab with its own title, language (or file name for detection), content and toolbar actions (API 1.3). Clicking an action sends `{ action, content }` back to the plugin, which replies with new content and/or a status message, or left/right content shown in the IDE's diff viewer. The tab follows the editor document lifecycle: modified marker, close-with-changes prompt, read-only, and saves whose reply arrives after newer edits (or that the plugin rejects) keep the document dirty.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
A tool-window web view can declare `header = "none"` (API 1.3) to render its own header. The host then replaces the standard header with corner actions (Options, Hide) once the frame has loaded, and tells the frame the corner inset to keep free (CSS variables) so the actions don't cover the plugin's controls. Views without the declaration, and the loading and error states of every view, keep the standard header.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
Closes#1943
Find Usages and Rename use document-indexer definitions and references next to language-server results. An indexed rename previews every name anchor and applies through the existing atomic workspace edit with grouped undo, guarded by index synchronization, canonical paths and document snapshots; a superseded rename preparation can't revive an obsolete session. Language-server Find Usages and Rename are unchanged. Released WIT is unchanged.
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>
Closes#1948
Plugins receive debounced batches of files created, changed and removed outside the editor in open projects, as SDK `Event::FilesChanged` (delivered through `other("files-changed", …)`, so released WIT is unchanged), under the `events` capability and the plugin's path filters. Activation on these events requires API 1.3. Batches are coalesced per plugin through its actor, survive cancellation without losing deltas, and are dropped when the project or host shuts down.
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>
Closes#1947
Adds API 1.3 `fs.plugin-dir`: a persistent owner-only directory per plugin (0700 directories / 0600 files on Unix, owner-only ACL on Windows), separate from the packaged code, storage and secrets. The plugin reads and writes under it without fs.* grants, can open files there in the editor and pass their paths to approved programs; editor saves keep the protection, restart keeps the content, uninstall removes it. Traversal and symlink escapes into other plugins' directories are rejected (real-Wasm regressions).
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>
Closes#2053
A call that begins a background task gets the longer `background` budget, but it was armed once, so a task that kept calling `report` was still killed at the first deadline. Each `report` and `is-cancelled` now renews it (the deadline only moves forward; silent work still times out), up to a 30-minute ceiling per task. User Cancel, disable and unload still interrupt the task, teardown interrupts a running task promptly, and cancellation is counted once. WIT change is documentation only. Verified on macOS with a 75 s task.
Co-authored-by: chaoes <26876656+chaoes@users.noreply.github.com>
Closes#1952
API 1.3 adds a diagnostics provider for unsaved documents: the host sends versioned text for the declared languages after a 300 ms debounce, cancels superseded calls, drops late or stale answers under the editor-provider budget, and clears results with the document, project or plugin. Ranges are UTF-16. Actor panics are contained, queued work is rejected after a host panic, and diagnostics arriving after plugin cleanup are discarded. Verified on macOS with the diagnostics fixture.
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>
A plugin web view can open a read-only editor tab that streams a process's output, with plugin-defined toggles, Find, wrap, zoom and Clear. The process is authorised in the backend against the exact granted `process:<program>` and its pinned executable, output is bounded, and the stream survives tab switches but ends when the tab closes, the plugin is disabled or the window closes. Adds a web-log test fixture and docs. Verified on macOS; Windows/Linux not run.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
A plugin web view can open interactive PTY sessions (spawn, input, resize, kill, streamed output and exit). Spawning requires the exact granted `process:<program>` and its pinned executable, with no PATH re-resolution or fallback shell; the cwd is the trusted project, arguments, environment (append-only) and sizes are validated, and at most eight sessions run per plugin. A frame can only drive the sessions it opened; output is acknowledged chunk by chunk and input/output are bounded. Sessions end on permission change, reload, disable, uninstall, frame teardown or window close. Requires API ^1.3; adds a web-pty test fixture. Verified on macOS; Windows/Linux not run.
Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
Closes#1950
Plugins can declare `detail = true` on a tree or list view (any tool-window side, grouped or not) to show the selected item's detail-provider tabs beside the list. The pane follows selection and refresh, clears stale content when the item, project or remote host changes, shows an empty state when nothing is selected, and remembers its resizable divider. Services keeps its single split. Released WIT and IPC shapes are unchanged. Verified on macOS in light and dark themes.
Co-authored-by: arnaud-ritti <77437157+arnaud-ritti@users.noreply.github.com>