"Add Database Source to Workspace" does not preserve loaded database

未关闭
#4,356 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript, vscode

调研方向

使用基于文件夹的 CodeQL 数据库,通过“Add Database Source to Workspace”操作重现该问题,然后跟踪 VS Code 工作区重新加载后哪些内容被持久化。比较重新打开工作区前后的数据库列表。当之前加载的数据库仍然列出,并且 AST 查看器无需手动重新添加即可使用该数据库时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug VSCode

Describe the bug
When using the "Add Database Source to Workspace" action and the current folder is re-opened as VS Code workspace, the opened database is not preserved; the list of databases is empty afterwards.

Version
Extension:

CodeQL extension version: 1.17.7 
CodeQL CLI version: 2.25.1 
Platform: win32 x64

VS Code:

Version: 1.113.0 (user setup)
Commit: cfbea10c5ffb233ea9177d34726e6056e89913dc
Date: 2026-03-24T15:07:18+01:00
Electron: 39.8.3
ElectronBuildId: 13620978
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

To reproduce

  1. Open a regular folder in VS Code
  2. Load a CodeQL database (folder-based)
  3. Right-click the database and select "Add Database Source to Workspace"
    ℹ️ As expected: The VS Code window is reloaded as workspace
    ℹ️ As expected: The database source was added
    ❌ Bug: The CodeQL database added in step 2 is not listed anymore as database, you have to manually re-add it

Expected behavior
After using "Add Database Source to Workspace" the database is still loaded

Additional context
The current behavior can be quite confusing. For example, I wanted to browse the AST of a database source file, so I loaded the database, selected "Add Database Source to Workspace", opened the source file and tried to open CodeQL's AST viewer. But it failed, saying that it could not find the database for the source.
Only then I noticed that the list of databases was empty (as mentioned in the description above).

主要语言
TypeScript
星标
539
派生
240
平均合并
2 天 6 小时
30 天内合并 PR
29

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/vscode-codeql 的其他 Issue

查看 github/vscode-codeql 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。