github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.49k stars 1.49k forks source link

VSCode extension AST viewer tab not showing AST for some files. #17068

Open aaaayush-n opened 1 month ago

aaaayush-n commented 1 month ago

Description of the issue

Hello, I am using the codeql using VSCode extension. I want to generate AST for a particular file but it just won't show me the AST. Please note that I can view the AST for some files(majority of them) but for a few files I am unable to do so. All these files are present in the CodeQL Database that was generated. I have verified from the src.zip file. There is no error when I click on CODEQL: View AST button on right click in my src file in both working and non-working cases.(I've added logs at the end of this issue) I have attached Images for the extension tab when It generates an AST and when it doesn't.

Logs for CodeQL: View AST working case:

Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set nodes /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-nFz0NKDOSDiYpdH5Ads_w/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set edges /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-nFz0NKDOSDiYpdH5Ads_w/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set graphProperties /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-nFz0NKDOSDiYpdH5Ads_w/results.bqrs...

CLI command succeeded.
Screenshot 2024-07-25 at 11 13 15 AM

Logs for CodeQL: View AST non-working case:

Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set nodes /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-yst2iLGzGqpy1dQl2oDU4/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set edges /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-yst2iLGzGqpy1dQl2oDU4/results.bqrs...

CLI command succeeded.
Reading bqrs data using CodeQL CLI: bqrs decode -v --log-to-stderr --format json --entities=id,url,string --result-set graphProperties /var/folders/p9/gkqn3kwx2llcc6m40ky4x25c0000gn/T/queries_-97292-WeHCoy2Wtomq/contextual-query-storage/printAst.ql-yst2iLGzGqpy1dQl2oDU4/results.bqrs...

CLI command succeeded.
Screenshot 2024-07-25 at 11 12 43 AM
mbg commented 1 month ago

Hi @aaaayush-n 👋

Do you have the logs for when you created the database (i.e. ran codeql database create ...) and, if so, could you share them?

aaaayush-n commented 1 month ago

@mbg I do not have the logs when the database was created, It was a long while back. Is there some other way I can help?

mbg commented 1 month ago

Some options: