yetone
33a284497e
plugin options: a switch a provider plugin declares is saved where the plugin reads it (plugins#550)
...
`magpie plugin options cursor '{"wire_trace": true}'` wrote the entry's
options in plugins.json (a middleware's ctx.options), while a provider
plugin's switches (auth.options, the editor's Plugin options) are read
from settings' PluginOptions (input.magpie.option). The command said
"options set" and Wire trace stayed off.
Now a key that the plugin declares as a switch for one of its providers
(from the providers last listed, else asked of the plugin host) goes to
PluginOptions for that provider, through settings.EditPluginOptions, and
a running host is handed it (SetProviderOptions, 5s, best effort). Only
true or false is taken for a switch. The other keys go to plugins.json
as before; set with switches only, a middleware's options stay, less a
switch written there before. `off` puts every switch back to the
plugin's default and clears plugins.json's options. Shown with no value,
each switch is listed with its value. docs/reference.md and the plugins
page (en, zh, ja) say so.
Run at this head on mote: go test ./internal/cli ./internal/settings
./internal/plugin ok; gofmt -l clean; go vet darwin and GOOS=windows ok;
Linux go vet -tags gtk3 in WSL (magpie-desktop) ok.
Broken by hand: no key read as declared, and both new tests went red
(PluginOptions empty, the old switch left in plugins.json).
Not tried: the real CLI against a running magpie with the Cursor plugin
installed; a plugin not listed yet (the host path) is not in a test.
2026-10-31 16:46:14 +08:00
..
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-31 11:03:35 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-28 08:28:56 +08:00
2026-10-31 14:40:03 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-21 19:58:52 +08:00
2026-10-13 23:30:17 +08:00
2026-10-12 20:40:22 +08:00
2026-10-27 07:30:16 +08:00
2026-10-27 07:30:16 +08:00
2026-10-27 07:30:16 +08:00
2026-10-27 07:30:16 +08:00
2026-10-29 09:24:31 +08:00
2026-10-20 02:29:39 +08:00
2026-10-31 13:14:16 +08:00
2026-10-12 20:40:22 +08:00
2026-10-13 16:19:13 +08:00
2026-10-24 14:52:13 +08:00
2026-10-27 18:22:01 +08:00
2026-10-27 18:22:01 +08:00
2026-10-27 12:08:16 +08:00
2026-10-17 20:52:13 +08:00
2026-10-21 09:13:30 +08:00
2026-10-14 08:32:41 +08:00
2026-10-14 13:36:03 +08:00
2026-10-15 03:34:59 +08:00
2026-10-13 05:34:13 +08:00
2026-10-29 05:19:28 +08:00
2026-10-31 13:44:29 +08:00
2026-10-30 14:33:01 +08:00
2026-10-31 03:48:27 +08:00
2026-10-31 13:44:29 +08:00
2026-10-13 15:25:06 +08:00
2026-10-24 21:33:06 +08:00
2026-10-24 21:33:06 +08:00
2026-10-31 00:57:21 +08:00
2026-10-31 00:57:21 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-25 18:18:02 +08:00
2026-10-25 18:18:02 +08:00
2026-10-12 20:40:22 +08:00
2026-10-13 13:10:30 +08:00
2026-10-31 14:45:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-31 14:45:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-21 09:13:30 +08:00
2026-10-17 12:04:53 +08:00
2026-10-21 09:13:30 +08:00
2026-10-24 21:33:06 +08:00
2026-10-31 14:45:22 +08:00
2026-10-31 02:49:08 +08:00
2026-10-29 15:52:42 +08:00
2026-10-31 02:49:08 +08:00
2026-10-25 19:34:55 +08:00
2026-10-23 01:58:00 +08:00
2026-10-31 14:45:22 +08:00
2026-10-31 14:45:22 +08:00
2026-10-13 13:02:58 +08:00
2026-10-31 14:45:22 +08:00
2026-10-24 02:48:50 +08:00
2026-10-15 23:08:03 +08:00
2026-10-31 15:04:44 +08:00
2026-10-12 20:40:22 +08:00
2026-10-31 15:04:44 +08:00
2026-10-31 15:04:44 +08:00
2026-10-13 18:16:03 +08:00
2026-10-12 20:40:22 +08:00
2026-10-24 05:31:59 +08:00
2026-10-24 05:51:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-14 05:43:48 +08:00
2026-10-27 02:26:27 +08:00
2026-10-27 10:01:46 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-25 13:19:52 +08:00
2026-10-15 22:36:59 +08:00
2026-10-31 16:46:14 +08:00
2026-10-15 22:36:59 +08:00
2026-10-13 18:01:20 +08:00
2026-10-31 16:46:14 +08:00
2026-10-28 09:29:44 +08:00
2026-10-28 09:29:44 +08:00
2026-10-31 00:53:27 +08:00
2026-10-14 16:40:24 +08:00
2026-10-30 04:48:17 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-30 23:59:31 +08:00
2026-10-15 23:08:05 +08:00
2026-10-31 11:03:35 +08:00
2026-10-12 20:40:22 +08:00
2026-10-31 04:21:21 +08:00
2026-10-21 19:00:33 +08:00
2026-10-12 20:40:22 +08:00
2026-10-15 05:20:17 +08:00
2026-10-25 13:19:52 +08:00
2026-10-31 00:41:29 +08:00
2026-10-12 20:40:22 +08:00
2026-10-14 15:02:15 +08:00
2026-10-14 15:02:15 +08:00
2026-10-14 20:49:20 +08:00
2026-10-31 00:41:29 +08:00
2026-10-12 22:42:46 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-13 14:41:10 +08:00
2026-10-12 20:40:22 +08:00
2026-10-30 14:45:56 +08:00
2026-10-15 23:08:00 +08:00
2026-10-30 14:56:01 +08:00
2026-10-12 20:40:22 +08:00
2026-10-25 02:13:44 +08:00
2026-10-12 20:40:22 +08:00
2026-10-29 23:56:05 +08:00
2026-10-29 23:56:05 +08:00
2026-10-13 13:02:09 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-31 05:00:39 +08:00
2026-10-12 20:40:22 +08:00
2026-10-14 08:26:04 +08:00
2026-10-28 08:28:56 +08:00
2026-10-26 22:22:27 +08:00
2026-10-14 13:36:03 +08:00
2026-10-14 13:36:03 +08:00
2026-10-29 22:16:56 +08:00
2026-10-29 22:16:56 +08:00
2026-10-29 17:47:30 +08:00
2026-10-29 17:47:30 +08:00
2026-10-15 23:08:03 +08:00
2026-10-26 21:09:44 +08:00
2026-10-31 11:39:04 +08:00
2026-10-12 20:40:22 +08:00
2026-10-12 20:40:22 +08:00
2026-10-31 11:39:04 +08:00
2026-10-16 20:11:34 +08:00
2026-10-23 01:58:01 +08:00
2026-10-14 15:26:28 +08:00
2026-10-31 14:45:22 +08:00
2026-10-13 09:56:06 +08:00
2026-10-20 00:18:51 +08:00
2026-10-27 18:58:16 +08:00
2026-10-27 18:58:16 +08:00
2026-10-26 22:22:27 +08:00
2026-10-15 00:15:27 +08:00
2026-10-12 22:55:22 +08:00