"Show AST" not working in codeql tab

Open
#4,339 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
64/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
c, typescript, vscode
Domain
devtools

Research direction

Start with the CodeQL tab's "Show AST" action and compare its command path with the context-menu "Show AST" action, which works for the same source file. Reproduce using the listed steps and confirm that the tab action displays the AST at the editor cursor without the invalid-source error.

Written by the indexing model from the issue text.

Description

bug VSCode

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.

Dominant language
TypeScript
Stars
539
Forks
240
Avg merge
2d 6h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/vscode-codeql

All issues in github/vscode-codeql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.