-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for viewing unit test databases with the AST viewer #2277
Comments
Hi @ewillonermsft, thank you for the issue! 😊 The extension doesn't really support unzipped source folders, so I think your workaround of manually zipping the (cc @aeisenberg - This looks like a duplicate of #1324, but could you confirm in case you have any extra context since it was opened last year? 😄) |
Or duplicate / relates to #393?
This is quite interesting though because the extension apparently explicitly prevents adding the source archive if the folder name ends with vscode-codeql/extensions/ql-vscode/src/databases/local-databases/database-item-impl.ts Lines 56 to 57 in 2410d2b
It is not clear to me why that is the case; the code and the comments don't seem to give any hint. Maybe due to potential issues when the test which created the database is executed again? Either way, the current behavior is a bit annoying because there is no indication that the source archive is intentionally ignored. I was wondering why even after I zipped the source files as
|
This workaround hasn't worked for me for several months, though I'm not sure exactly when it stopped. It would be awesome if this work flow could get improved rather than constantly looking for work arounds. |
Your workaround still works for me with extension version 1.9.1 and CodeQL CLI version 2.14.6, also on Windows. A few important points:
Maybe there could also be a problem with your VS Code workspace? For me it works when the project was already opened as workspace; and in case it was only opened as regular folder, the CodeQL VS Code extension seems to convert it to a workspace automatically. Maybe some of this is not working for you? Though I agree that a proper solution instead of these workarounds would be great. |
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:
Additional context
I have only tested this on Windows, I am unsure of if the existing workaround works on Linux or MacOS.
The text was updated successfully, but these errors were encountered: