Add support for viewing unit test databases with the AST viewer

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
typescript, vscode
领域
devtools

调研方向

首先在 CodeQL VS Code 扩展中复现单元测试工作流,并跟踪 AST 查看器如何处理导入的数据库。完成的标准是:无需手动进行归档和文件夹的变通操作,即可导入单元测试数据库并查看其源代码 AST;该 issue 仅确认了在 Windows 上的测试,因此还需要检查 Linux 和 macOS 上的行为。

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

描述

enhancement VSCode

Is your feature request related to a problem? Please describe.
When developing CodeQL queries, it is convenient to write unit tests and query the database that is output from running them to iteratively test/develop a query. The alternative is to maintain a separate project and database which increases the number of moving parts and commands that need to be run when altering code or building additional tests and debugging. Currently you can import a unit test database using the CodeQL extension, however you will not be able to view the AST of its source code.

The current workaround is cumbersome and time consuming, it would be great if it could be automatically handled by the extension.

Describe the solution you'd like
Unit test databases imported by CodeQL VSCode extension should be able to have their AST viewed without performing extra steps.

Describe alternatives you've considered
Currently, the work around looks like this:

  1. Run the unit test using the unit test tab in VS Code.
  2. Navigate to the unit test path. You will see a XYZ.testproj folder.
  3. Remove .testproj from the folder name
  4. Navigate to XYZ/src and zip the folder inside. Rename to src.zip
  5. Move the newly created src.zip to the XYZ unit test directory
  6. Delete the src/ folder
  7. Import the database with the CodeQL extension. You will now be able to view the AST.

Additional context
I have only tested this on Windows, I am unsure of if the existing workaround works on Linux or MacOS.

主要语言
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 摘要。