Skip to content

fix(extension): replace configuration proxy to prevent activation failure - #11

Open
shuntianyifang wants to merge 1 commit into
Unclecheng-li:mainfrom
shuntianyifang:fix/extension-configuration-proxy
Open

fix(extension): replace configuration proxy to prevent activation failure#11
shuntianyifang wants to merge 1 commit into
Unclecheng-li:mainfrom
shuntianyifang:fix/extension-configuration-proxy

Conversation

@shuntianyifang

@shuntianyifang shuntianyifang commented Aug 24, 2026

Copy link
Copy Markdown

修改内容

修复 DeepSec 扩展在新版 VS Code 中无法激活的问题。

本次修改:

  • 移除对 VS Code WorkspaceConfiguration 对象的 Proxy 包装;
  • 使用普通兼容对象实现配置读取;
  • 保留 deepsec.* 配置优先级;
  • 保留旧版 vibeguard.* 配置回退;
  • 配置更新仍写入 deepsec.*
  • 避免触发 JavaScript Proxy 不变量错误。

问题原因

原来的 configuration() 使用 Proxy 替换
WorkspaceConfiguration.getinspect

新版 VS Code 将这些属性暴露为不可配置的只读属性。Proxy 返回不同的
方法实现时会违反 JavaScript Proxy 不变量,导致扩展激活失败:

'get' on proxy: property 'get' is a read-only and non-configurable data
property on the proxy target but the proxy did not return its actual value

扩展在注册命令前退出,因此会出现命令面板中能看到命令,但执行时提示:

命令“DeepSec:Scan Current File"导致错误
command 'deepsec.scanCurrentFile' not found

验证结果

  • TypeScript 类型检查通过;
  • 279 项自动化测试全部通过;
  • dist/extension.js 构建成功;
  • VSIX 打包成功;
  • 在 VS Code 1.134.0 中扩展可以正常激活;
  • DeepSec: Scan Current File 可以正常运行;
  • 代码诊断标红和快速修复可以正常显示。

修复 #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant