gpt4 book ai didi

javascript - 使用v8插件实现sublime text 2的js插件

转载 作者:行者123 更新时间:2023-11-30 09:01:14 25 4
gpt4 key购买 nike

我正在尝试使用 v8 插件在 javascript 中为 sublime text 2 编写插件。有一个名为 test.js 的演示 javascript 文件,它似乎是一个完整的测试插件,但我不知道如何激活它。

有没有人设法使用 javascript 为 sublime text 2 编写插件?

还有其他方法可以解决这个问题吗?我主要想将文本发送到 javascript 以供我的各种库处理,然后发回文本。


编辑:我正在使用这个项目让 v8 与 sublime 一起工作:https://github.com/akira-cn/sublime-v8

最佳答案

你可以试试这个插件https://github.com/akira-cn/SublimeJS

按照示例:

/** package.json **/

{
"name": "JSDemo",
"description": "demo plugin powered by SublimeJS",
"version": "0.1.0",
"author": {
"name": "akira-cn",
"email": "akira.cn@gmail.com"
},
"main": "index.js",
"licenses": [{
"type": "The MIT License",
"url": "http://www.opensource.org/licenses/mit-license.php"
}]
}
/** index.js **/

defineCommand("Hello", require("hello.command"));
/** hello.command.js **/

module.exports = function(view, edit) {
view.insert(edit, 0, "HelloWorld");
}

关于javascript - 使用v8插件实现sublime text 2的js插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9154078/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com