How does one close an editor programmatically in Visual Studio Code? The docs say TextEditor.hide() is deprecated and that we should "Use the command workbench.action.closeActiveEditor instead", but I can't find the workbench.action API.
It's not really an "API", but an identifier for a command in the command palette (see keybindings.json for a list). An extension can invoke commands via executeCommand():
vscode.commands.executeCommand("workbench.action.closeActiveEditor");
This is equivalent to selecting the View: Close Editor command manually or pressing the associated shortcut:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With