【发布时间】:2021-01-06 16:56:07
【问题描述】:
我正在尝试为我的节点 js 服务器编写 ST3 插件。为了运行它,我调用了命令view.run_command('Node js.nodejs')。
我的 Sublime Text Packages 文件夹如下所示:
│ main.py
│ text_example_one.py
│
├───Node js
│ Nodejs.py
│
└───User
│ main.py
│ Package Control.last-run
│ Package Control.sublime-settings
│ Preferences.sublime-settings
│
└───Package Control.cache
01524fae79697630d0454ba3fabd9414
01524fae79697630d0454ba3fabd9414.info
../Packages/Node js/Nodejs.py 文件包含以下代码:
import sublime, sublime_plugin
class TryCommand(sublime_plugin.TextCommand):
def run(self, edit):
print("It's working")
self.view.insert(edit, 0, "Hello, World!")
当view.run_command('Node js.nodejs') 被调用时,什么都没有发生,参见the image of the window here。
未引发错误,但未插入 "Hello, World!" 消息且未在控制台中打印 "It's working"。
【问题讨论】:
标签: sublimetext3 sublimetext sublime-text-plugin