Skip to content

"Show AST" not working in codeql tab #4339

@k4lizen

Description

@k4lizen

Describe the bug
When I select a database in VS Code and open a source file (C language), go to the CodeQL tab and click "Show AST" I get

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

Version
The CodeQL and VS Code version in which the bug occurs.

CodeQL extension version: 1.17.7 CodeQL CLI version: 2.23.8 Platform: linux x64

The linux Arch-packaged vscode:

extra/code 1.111.0-2 (30.5 MiB 202.5 MiB) (Installed)

To reproduce

  1. Open vscode
  2. Compile database
  3. Open database in codeql vscode extension
  4. Navigate to a source file using the vscode file explorer
  5. Click on the codeql extension button on the left vertical bar
  6. Click "Show AST"
  7. Error

Expected behavior
Thingy works, and shows the AST under the editor cursor position.

Additional context
Note that if I do right-click on the source and "Show AST" (instead of clicking the button in the codeql extension tab), it does work properly.

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