假设在我的自定义 Atom 包中,我将 JSON 字符串插入到文件中。之后,我想自动运行beautify-language-jsonfromatom-beautify包。如何从我的包中启动此命令?
1 回答

守着星空守着你
TA贡献1799条经验 获得超8个赞
如 API 文档中所述,您可以使用该dispatch()方法。
例子:
// Example - you *might* want to use a different target
const target = atom.views.getView(atom.workspace);
const commandName = 'atom-beautify:beautify-language-json';
atom.commands.dispatch(target, commandName);
添加回答
举报
0/150
提交
取消