ReadonlyregisteredIds currently registered, in registration order.
Invokes a command, resolving with whatever the handler returned and rejecting with whatever it threw.
Invokes a text editor command with a scripted editor, standing in for VS Code invoking it against the focused one.
Returns the fake-only { settled } hook after the handler returns. The
text-editor command port exposes no command result; settled separately
tracks the handler value or promise so a test can await framework work. A
synchronous handler throw escapes before this hook can be returned.
Takes the editor port rather than a whole fake editor: a test that only
cares that the command ran can pass
createFakeEditor().active as ActiveTextEditor.
Number of times each command was invoked.
Registers one handler for id. The returned registration removes it; a
platform conflict may throw synchronously during registration.
Registers a text editor command.
VS Code only invokes it with an editor focused; with none it logs "no
active text editor" and skips the handler. It does not grey the
command out in the palette — that is the enablement / commandPalette
when clause in package.json.
Fire-and-forget, unlike CommandCapability.register. VS Code's
wrapper runs the handler inside activeTextEditor.edit(...) and discards
what it returned, logging a rejection rather than propagating it
So execute on such a command may resolve undefined while an async
handler is still running. A command whose caller needs the result or the
failure must be a plain one.
The editor arrives as the same port active returns, so a handler works
with one editor shape however its command was declared. VS Code's
synchronous TextEditorEdit builder is deliberately not passed through:
it validates its arguments with instanceof Range, so it cannot cross a
port, and it is closed by the time an operation-wrapped handler resumes.
In-memory command capability for tests.
Mirrors the command port's observable behavior rather than being lenient: a duplicate id throws, an unknown id rejects, and both return values and rejections propagate. Shared contract tests pin the real adapter behavior represented here; VS Code behavior outside the port is not implied.