docs(sdk): plugin minimal en dossier + hot reload documentés — manifest (arborescence minimale idea-plugin.json/package.json/tsconfig/src/dist, install depuis dossier), packaging-distribution (procédure hot reload directory install + idea_plugin_reload + limites UI React), README (lien packaging hot reload)
This commit is contained in:
@ -74,3 +74,55 @@ npm run package:hello-plugin
|
||||
|
||||
The resulting archive has no wrapping parent directory and is ready for IdeA's
|
||||
plugin installer.
|
||||
|
||||
## Hot Reload During Development
|
||||
|
||||
Install the plugin from a directory when you want IdeA to hot-reload changes
|
||||
without restarting the app.
|
||||
|
||||
In IdeA, open `Paramètres > Plugins`, choose `Installer depuis un dossier…`,
|
||||
and select the plugin source directory. That directory must contain
|
||||
`idea-plugin.json` at its root, and the manifest `main` field must point to the
|
||||
built entrypoint that exists inside the same directory, for example
|
||||
`dist/index.js`.
|
||||
|
||||
```text
|
||||
hello-plugin/
|
||||
├── idea-plugin.json
|
||||
├── package.json
|
||||
└── dist/
|
||||
├── index.js
|
||||
└── core/
|
||||
└── layout.js
|
||||
```
|
||||
|
||||
After editing plugin source files, rebuild the plugin output first:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
Then ask an IdeA agent that has the plugin administration tool available to run
|
||||
`idea_plugin_reload` with the installed plugin id:
|
||||
|
||||
```json
|
||||
{
|
||||
"pluginId": "com.example.hello-plugin"
|
||||
}
|
||||
```
|
||||
|
||||
The reload uses the recorded directory source from the plugin registry. It
|
||||
re-reads and validates the manifest, recalculates the package hash, updates the
|
||||
installed package, emits `plugin_reloaded`, and reconciles plugin MCP servers.
|
||||
It does not accept an arbitrary path at reload time; install from the intended
|
||||
development directory first.
|
||||
|
||||
Do not install from the ZIP archive for a development loop that needs hot
|
||||
reload. Archive installs are fixed package snapshots. They are appropriate for
|
||||
distribution, but the reload command is only defined for plugins installed from
|
||||
a directory source.
|
||||
|
||||
Current limitation: backend registry state and plugin MCP/tool contributions are
|
||||
reloaded without restarting IdeA. Frontend React contributions that are already
|
||||
loaded in the current UI session may keep their existing module instance until
|
||||
the relevant plugin surface is recreated or the app session is restarted.
|
||||
|
||||
Reference in New Issue
Block a user