为了账号安全,请及时绑定邮箱和手机立即绑定

来自另一个包的 Atom 包命令

来自另一个包的 Atom 包命令

泛舟湖上清波郎朗 2022-05-26 14:41:42
假设在我的自定义 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);


查看完整回答
反对 回复 2022-05-26
  • 1 回答
  • 0 关注
  • 85 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号