Description
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:
- Run the unit test using the unit test tab in VS Code.
- Navigate to the unit test path. You will see a XYZ.testproj folder.
- Remove .testproj from the folder name
- Navigate to XYZ/src and zip the folder inside. Rename to src.zip
- Move the newly created src.zip to the XYZ unit test directory
- Delete the src/ folder
- 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.