比方说,在我的自定义Atom包中,我将JSON字符串插入文件中。
之后,我想自动运行beautify-language-json
程序包中的atom-beautify
。
如何从软件包中启动此命令?
答案 0 :(得分:0)
如API文档中所述,您可以为此使用dispatch()
方法。
示例:
const target = atom.views.getView(atom.workspace);
const commandName = 'atom-beautify:beautify-language-json';
atom.commands.dispatch(target, commandName);