【问题标题】:VSCode: Unable to write to Workspace Settings because no workspace is opened. Please open a workspace first and try againVSCode:无法写入工作区设置,因为没有打开工作区。请先打开一个工作区,然后重试
【发布时间】:2020-09-02 13:10:20
【问题描述】:

我正在编写一个 vscode(Visual Studio Code) 扩展,当我尝试更新如下代码的配置时,我会收到这个错误:rejected promise not handled within 1 second: Error: Unable to write to Workspace Settings because no workspace is opened. Please open a workspace first and try again.

我的代码:

vscode.workspace.getConfiguration("myextention").update("myextention.conf", "231231223");

【问题讨论】:

    标签: node.js typescript visual-studio-code vscode-extensions


    【解决方案1】:

    我也遇到了同样的问题。

    错误的意思是:

    使用您的扩展程序的用户必须打开保存配置的工作区。

    工作区不是您用于开发扩展的地方。


    您可以查看How to store data for each "user" - VSCode Extention了解另一种保存参数的方式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-18
      • 1970-01-01
      相关资源
      最近更新 更多