visual-studio-code - 如何从 Visual Studio Code 扩展中的 globalState 获取 id?
问题描述
在vscode
扩展上下文中,有globalState
. globalState 是一个 ExtensionMemento 对象,在运行时调试时我可以看到它有一个私有_id
.
我如何获得身份证?我试过了:
context.globalState.get<string>("id");
context.globalState.get<string>("_id");
...但每个返回未定义。
解决方案
context.globalState["_id"]
推荐阅读
- c++ - 未解析的外部符号,但功能已定义和实现
- javascript - 复选框上的多行选择和单击 MUI DataGrid 中的行时的单选
- javascript - 为什么我的 sessionStorage 给出 { 'object Object': '' }
- python - 安装 mod_wsgi 时如何修复错误消息?
- flutter - 如何从您的电子商务应用程序中共享产品
- spring-boot - java存储库将抽象类属性保存为null
- node.js - 使用 NodeJS promise 查询 MySQL 通配符
- python - 如何在不影响原始列表的情况下修改类中的列表?
- elasticsearch - Elasticsearch的复杂查询根据不同时间统计文档数
- android-jetpack-compose - 在循环中重新组合多个 Composable