Skip to content

Extension fails to activate in Trae: "command 'deepsec.openReport' not found" Vsix扩展与Trae魔改后的vscode不兼容导致的扩展失效 #6

Description

@RGthx

Extension fails to activate in Trae: "command 'deepsec.openReport' not found"

环境

  • 扩展版本: 0.2.0
  • IDE: Trae CN(基于 VS Code)
  • 操作系统: Windows
  • deepsec CLI: 可正常运行(deepsec report --help 正常)

问题描述

扩展激活失败,所有 deepsec.* 命令(如 deepsec.openReport)都报
"command 'deepsec.openReport' not found"。

错误日志 (exthost.log)

[error] Activating extension unclecheng.deepsec-security failed due to an error:
[error] TypeError: '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 (expected '...' but got '(section, defaultValue) => {...}')
	at createFindingStore (extension.js:21336:23)
	at activate (extension.js:20016:18)

根因分析

configuration() 函数用 new Proxy() 包裹 vscode.workspace.getConfiguration("deepsec")
返回的配置对象,并拦截 get 属性返回自定义函数。但 VS Code/Trae 的配置对象本身是
Proxy,且 get 属性是只读且不可配置的。外层 Proxy 替换 get 属性违反了该约束,
导致 createFindingStore() 调用 configuration().get("storeFindings", true) 时抛
TypeErroractivate() 中断,命令未注册。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions