Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onDidExecuteCommand API #72345

Merged
merged 8 commits into from Jul 24, 2019

Conversation

@hedgerh
Copy link
Contributor

commented Apr 15, 2019

Implemented based on conversations in #1431

This PR adds a new onDidExecuteCommand event to the commands namespace of the VSCode API.
This allows extensions to be able to subscribe and react to both extension and UI side events with a callback function.

One possible use case is a live macro recording feature.

Example usage:

vscode.commands.onDidExecuteCommand(({ commandId, args }: { commandId: string, args: any[] }) => {
  if (commandId === 'type') {
    vscode.window.showInformationMessage(`Key pressed: ${args[0]}`)
  }
})
@msftclas

This comment has been minimized.

Copy link

commented Apr 15, 2019

CLA assistant check
All CLA requirements met.

src/vs/vscode.proposed.d.ts Outdated Show resolved Hide resolved
src/vs/workbench/api/common/extHostCommands.ts Outdated Show resolved Hide resolved
src/vs/workbench/api/common/extHostCommands.ts Outdated Show resolved Hide resolved
src/vs/workbench/api/common/extHostCommands.ts Outdated Show resolved Hide resolved

@hedgerh hedgerh force-pushed the hedgerh:command-execute-events branch from f524d4b to dea4f81 Apr 16, 2019

@hedgerh hedgerh changed the title RFC/WIP: onDidExecuteCommand API onDidExecuteCommand API Apr 30, 2019

@hedgerh hedgerh force-pushed the hedgerh:command-execute-events branch from 1bbfa21 to 6f21c1b Apr 30, 2019

@jrieken
Copy link
Member

left a comment

👍 looks much better now, left a few nits but then it'll be good for merging

src/vs/workbench/api/common/extHost.protocol.ts Outdated Show resolved Hide resolved
src/vs/workbench/api/common/extHostCommands.ts Outdated Show resolved Hide resolved
@jrieken

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

Thanks! This now looks good to me. We are currently in endgame-mode and I have to see if I can still merge this for the April release, otherwise this goes in for May

@jrieken jrieken modified the milestones: April 2019, May 2019 Apr 30, 2019

@hedgerh hedgerh force-pushed the hedgerh:command-execute-events branch from 27a85a5 to ab76947 May 5, 2019

jrieken added some commits May 16, 2019

@jrieken jrieken modified the milestones: May 2019, June 2019 May 28, 2019

@hedgerh

This comment has been minimized.

Copy link
Contributor Author

commented Jun 22, 2019

Hey hey @jrieken, just checking in on this PR. Is there anything I should be doing at this point? I read the docs on proposing Extension API changes, but it sounds like it's geared towards actual MS team members. Do you all pick carry the torch from here? Cheers.

@jrieken

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Yeah, sorry. I keep moving this as I haven't done proper testing about the affects of sending arguments over yet. Internally we often send arguments that cannot be serialised, e.g. we will fail to send them to the extension host side. While that's fine we don't know of the (performance) implications yet.

@jrieken jrieken modified the milestones: June 2019, July 2019 Jun 24, 2019

@jrieken jrieken merged commit 6a25cfa into microsoft:master Jul 24, 2019

1 of 5 checks passed

VS Code Build #20190628.46 had test failures
Details
VS Code (Linux) Linux failed
Details
VS Code (Windows) Windows failed
Details
VS Code (macOS) macOS failed
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.