Skip to content

"Cannot view the AST" #944

@kumom

Description

@kumom

Describe the bug
I tried to see the AST generated by CodeQL in VS Code. I chose the torvalds/linux database downloaded from LGTM.com, but when the src.zip in the database or some *.c file unzipped from the src.zip is selected in the editor, the AST cannot be generated. The error message shows

Cannot view the AST. Please select a valid source file inside a CodeQL database. (codeQL.viewAst)

Version
CodeQL extension version: 1.5.4 CodeQL CLI version: 2.6.0 Platform: darwin x64

VS Code:
Version: 1.60.0
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:54:53.442Z (4 days ago)
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

To reproduce

  1. Select torvalds/linux database in the DATABASES panel
  2. Drag the src.zip in the database to the editor. Click View AST in the AST VIEWER panel.
  3. Unzip src.zip in the database. Open a random *.c file in the editor. Click View AST in the AST VIEWER panel.

Expected behavior
I actually don't know what to expect (i.e., whether it will produce a description of the graph or an image file) because the documentation does not give any examples. That's why I'd like to try it myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    VSCodebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions