winzik/skeleton-plugin/AGENTS.md
David Nurdin ab0d4a09f7 JumPHP IDE: plugins in PHP (0.1.24)
- ide/src/Plugin: Plugin (activate(Api)), Api (actions with menus and shortcuts, tool windows made of Ui nodes whose
  callbacks run in PHP, run configurations, completion, problems, listeners, timers, notify / openFile / run,
  workspace, settings), PluginHost (found in the user's plugins and the project's .jumphp/plugins/, a failing
  plugin reported and never fatal, install / enable / remove, plugins.* commands)
- ide/src/Testing/PluginTestCase: a plugin played without a window (project, action, toolText, click, submit,
  complete, problems, save, wait)
- the interface: plugins.js (their tool windows, actions in the menus and the key map, completion and problems,
  Tools > Plugins…), New Project > IDE plugin; a "null" no longer shows beside the background task
- bin/jumphp plugin:new / plugin:pack, test of a plugin's folder; skeleton-plugin/, games/hello-plugin (TODO Finder)
- docs/ide-plugins.md, AGENTS.md §19

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X3cUrpEPheHAT512jkSvAK
2026-11-02 23:38:33 +01:00

12 lines
955 B
Markdown

# {{GAME_ID}} — a plugin of the JumPHP IDE
PHP that runs inside the JumPHP IDE. Read docs/ide-plugins.md of JumPHP (the API, the Ui nodes, the tests) first.
- `composer.json` `extra.jumphp-ide`: id, name, version, the plugin's class; `autoload` psr-4 (a namespace of its
own: `JumphpPlugins\...`). No package of its own at run time: only PHP and the IDE's (nikic/php-parser, symfony/yaml).
- `src/TodoPlugin.php` implements `JumPHP\Ide\Plugin\Plugin`: `activate(Api $ide)` adds actions, tool windows,
run configurations, completion, problems, listeners, timers.
- Never block: the plugin runs on the IDE's frame (no sleep, no long loops, no network waits).
- Tests: `tests/*Test.php` extend `JumPHP\Ide\Testing\PluginTestCase` (a project of a few files, the plugin loaded,
`action()`, `toolText()`, `click()`, `submit()`, `complete()`, `problems()`, `save()`, `wait()`, `notifications()`,
`opened()`). `bin/jumphp test {{GAME_ID}}` must pass.