How to reuse another extension features? #2515
-
Hi! I am developing an extension that should be aware of current Maven / Gradle project structure (module roots, sources roots, resources roots). I see that vscode-maven does the project structure analysis already. Is it possible to call classes / utilities (like MavenProjectManager) from that extension in my extension? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @MarcinVaadin , There are two ways you can interact with / use another extension feature: Using its commandsThe simpler, but also limited way is using its await commands.executeCommand("editor.action.clipboardCopyAction");
Using exposed APIsThe 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 to get in touch with the maintainers of the MavenProjectManager extension, to ask for APIs that fulfill your needs. Hope this helps |
Beta Was this translation helpful? Give feedback.
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 thecommands.executeCommand
API. Something like: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…