Skip to content

Creating skeleton query pack shows spurious CodeQL compilation errors #3220

Closed
@Marcono1234

Description

@Marcono1234

Describe the bug
When creating a skeleton query pack using the extension it creates an example query (example.ql) and opens it automatically.
However, it directly reports compilation errors there about unresolved modules. These errors seem to be spurious though, compiling the query works fine.

This is quite problematic because creating the example query is probably the first thing new users do, and it can be quite confusing if they directly run into (spurious) errors then.

Whether this error occurs seems to depend on the state of %userprofile%/.codeql (on Windows; possibly similar on Linux).

Version

CodeQL extension version: 1.11.0 
CodeQL CLI version: 2.15.5 
Platform: win32 x64

VS Code:

Version: 1.85.1 (user setup)
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:49:37.021Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

To reproduce

  1. Close VS Code
  2. Delete %userprofile%/.codeql (on Windows)
    (to be safe verify first that it does not contain anything valuable)
  3. Open an empty folder with VS Code
  4. In the CodeQL tab under "Queries" click "Create one to get started", or alternatively run the command "> CodeQL: Create Query"
  5. Select "Java" as language
  6. Wait until the extension automatically opens the example.ql file
    ❌ Bug: The extension shows multiple compilation errors
    Compilation errors screenshot
  7. Try to run the query
    ✔️ Compilation succeeds, as expected

Expected behavior
The extension should not show spurious compilation errors

Additional context
Besides that I really like this functionality of creating a skeleton pack; this seems to make it really easy to get started (though I had been using the extension before, so maybe a real new user might experience this differently).

Metadata

Metadata

Assignees

No one assigned

    Labels

    VSCodebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions