首页 > 解决方案 > 如何从 Visual Studio Code 扩展中的 globalState 获取 id?

问题描述

vscode扩展上下文中,有globalState. globalState 是一个 ExtensionMemento 对象,在运行时调试时我可以看到它有一个私有_id.

我如何获得身份证?我试过了:

 context.globalState.get<string>("id");  
 context.globalState.get<string>("_id"); 

...但每个返回未定义。

标签: visual-studio-codevscode-extensions

解决方案


context.globalState["_id"]


推荐阅读