【问题标题】:Use vscode insider extension API使用 vscode 内幕扩展 API
【发布时间】:2018-03-20 15:36:29
【问题描述】:

我正在编写一个 VSCode 扩展,但我需要使用最新的扩展 API。如何告诉我的 package.json 在我的扩展中使用 vscode API 的内部版本?我试过了:

"devDependencies": {
    [...],
    "vscode": "^1.22.0-insider"
},

但我明白了:

$ npm install
npm ERR! code ETARGET
npm ERR! notarget No matching version found for vscode@^1.22.0-insider
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

【问题讨论】:

    标签: visual-studio-code vscode-extensions


    【解决方案1】:

    在你的package.json,设置:

    "engines": {
        "vscode:" "*"
    }
    

    然后再次运行 npm postinstall 脚本(或者只运行 npm install 重新触发它)

    * 从 VS Code 在 github 上积极开发的分支中提取最新的 vscode.d.ts。确保在发布您的扩展程序之前将 engines 更改为真正的 VS Code 版本,例如 "^1.28.0"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-23
      • 1970-01-01
      • 2023-02-14
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多