Is it possible to define a Command in one plugin and use it at another plugin?
是否可以在一个插件中定义一个Command并在另一个插件中使用它?
Thanks Patrick
3 个解决方案
#1
0
Yes! Commands are designed as abstractions. They can be found with their ids and can be used in other plugins. You don't even have to depend on the plugin that defines the command.
是!命令被设计为抽象。可以使用它们的ID找到它们,也可以在其他插件中使用它们。您甚至不必依赖定义命令的插件。
#2
0
I think it is possible by adding the plugin which has the Command to the dependencies of the other plugin in which you want to use it.
我认为通过将具有Command的插件添加到您想要使用它的另一个插件的依赖项中是可能的。
#3
0
You don't even need a dependency to the plug-in defining the command.
您甚至不需要依赖于定义命令的插件。
As soon as the command is declared, it is made known to the ICommandService
which is provided by the workbench.
一旦声明了命令,就会使工作台提供的ICommandService知道它。
#1
0
Yes! Commands are designed as abstractions. They can be found with their ids and can be used in other plugins. You don't even have to depend on the plugin that defines the command.
是!命令被设计为抽象。可以使用它们的ID找到它们,也可以在其他插件中使用它们。您甚至不必依赖定义命令的插件。
#2
0
I think it is possible by adding the plugin which has the Command to the dependencies of the other plugin in which you want to use it.
我认为通过将具有Command的插件添加到您想要使用它的另一个插件的依赖项中是可能的。
#3
0
You don't even need a dependency to the plug-in defining the command.
您甚至不需要依赖于定义命令的插件。
As soon as the command is declared, it is made known to the ICommandService
which is provided by the workbench.
一旦声明了命令,就会使工作台提供的ICommandService知道它。