forked from 1b-agent/opencadstudio-upstream
fix(plugin): append the multi-entity command steps after the existing ones
#1469 inserted `CommitMany` and `CommitManyAndEnd` between `Commit`, `CommitAndEnd` and `Done`. `CommandStep` crosses the plugin IPC, which encodes a variant by its position, so a plugin built against the previous API that answered `Done` would have been read as `CommitAndEnd` — or rejected as undecodable — by the new host. The two variants now sit after `Cancel`, as the other additions to the v7 wire types do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8ae804d921
commit
73b560de99
1 file changed
+8
-4
@@ -710,16 +710,20 @@ pub enum CommandStep {
|
|||||||
NeedPoint,
|
NeedPoint,
|
||||||
/// Commit an entity to the document and keep collecting points.
|
/// Commit an entity to the document and keep collecting points.
|
||||||
Commit(EntityType),
|
Commit(EntityType),
|
||||||
/// Commit multiple entities to the document and keep collecting points.
|
|
||||||
CommitMany(Vec<EntityType>),
|
|
||||||
/// Commit an entity and end the command.
|
/// Commit an entity and end the command.
|
||||||
CommitAndEnd(EntityType),
|
CommitAndEnd(EntityType),
|
||||||
/// Commit multiple entities to the document and end the command.
|
|
||||||
CommitManyAndEnd(Vec<EntityType>),
|
|
||||||
/// End the command without committing.
|
/// End the command without committing.
|
||||||
Done,
|
Done,
|
||||||
/// Cancel the command.
|
/// Cancel the command.
|
||||||
Cancel,
|
Cancel,
|
||||||
|
// New variants go after the existing ones: the step crosses the plugin
|
||||||
|
// IPC, which encodes a variant by its position, so inserting one earlier
|
||||||
|
// would make a plugin built against the previous API send `Done` and
|
||||||
|
// have the host read it as something else.
|
||||||
|
/// Commit multiple entities to the document and keep collecting points.
|
||||||
|
CommitMany(Vec<EntityType>),
|
||||||
|
/// Commit multiple entities to the document and end the command.
|
||||||
|
CommitManyAndEnd(Vec<EntityType>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Export a `BuiltinPlugin` from a `cdylib` so the host can load it at runtime.
|
/// Export a `BuiltinPlugin` from a `cdylib` so the host can load it at runtime.
|
||||||
|
|||||||
Reference in new issue
Block a user