可以从命令行调用 VSCode 扩展命令吗? [英] Possible to invoke a VSCode extension command from command line?
问题描述
是否可以从终端调用 VSCode 扩展命令?
Is it possible to invoke a VSCode extension command from a terminal?
我知道 code
命令和 Extensions Management
类别下的所有开关.但是,我不明白是否可以从命令行调用在 VSCode 扩展中实现的命令,还是要求用户必须从编辑器的上下文中调用它?
I'm aware of the code
command and all the switches under the Extensions Management
category. However, I do not understand if it's possible to invoke a command implemented within a VSCode extension from the command line or it is required that a user must invoke it from the editor's context?
在谷歌搜索和搜索 StackOverflow 之后,我似乎找不到明确的答案,所以我提出了一个新问题.有什么见解吗?
I cannot seem to find a definitive answer after Googling and searching StackOverflow, so I'm asking as a new question. Any insights?
推荐答案
我可以使用的丑陋解决方法 - https://marketplace.visualstudio.com/items?itemName=gabrielgrinberg.auto-run-command
Ugly workaround I can use - https://marketplace.visualstudio.com/items?itemName=gabrielgrinberg.auto-run-command
编写配置文件并启动 vscode(应该触发该任务,检查文件是否存在,运行命令)并关闭 vscode
write config file and start vscode (which should trigger that task, check if file exists, run commands) and close vscode
很遗憾,暂时没有更好的解决方案
Sad, that there is no better solution for a while
这篇关于可以从命令行调用 VSCode 扩展命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!