Skip to content

How to reuse another extension features? #2515

Discussion options

You must be logged in to vote

Hi @MarcinVaadin ,

There are two ways you can interact with / use another extension feature:

Using its commands

The simpler, but also limited way is using its commands. You can run any registered command, from other extensions or native in VS Code, using the commands.executeCommand API. Something like:

    await commands.executeCommand("editor.action.clipboardCopyAction");

This approach doesn't require any changes on the original extension

Using exposed APIs

The more professional way is using APIs that the extension has exposed. This documentation provides more information: https://code.visualstudio.com/api/references/vscode-api#extensions about the process.

In this case, you would need…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MarcinVaadin
Comment options

Answer selected by alefragnani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants