Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

No Diagnostics from CodeQL Language Server

Aperta
#4,303 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Ambito
devtools

Direzione di ricerca

Riproduci la sequenza con codeql execute language-server --check-errors=ON_CHANGE -v: inizializza lo spazio di lavoro, apri codeql-pack.yml, quindi apri un file .ql contenente errori di sintassi e semantici. Esamina le notifiche LSP e le opzioni di inizializzazione relative al caricamento del pack; il lavoro è completato quando viene identificata la configurazione o la notifica necessaria affinché la diagnostica riprenda dopo l’apertura del pack.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug VSCode

Describe the bug
CodeQL Language Server suppresses diagnostics when a QL pack is loaded

Context:
We are building a headless Python LSP client for CodeQL to automate query synthesis. We are using the CodeQL CLI version 2.20.1 (via codeql execute language-server).

Current Implementation:

  1. Server Start: codeql execute language-server --check-errors=ON_CHANGE -v
  2. Initialization: Standard initialize request with rootUri pointing to a workspace.
  3. Pack Setup: We create a valid codeql-pack.yml in the workspace with dependencies: { codeql/cpp-all: "^4.3.1" } and run codeql pack install.
  4. Pack Loading: We send textDocument/didOpen for the codeql-pack.yml file to trigger pack resolution (this successfully fixes "unresolved module" errors).
  5. Query Opening: We send textDocument/didOpen for a .ql query file inside the pack.
library: false
name: temp-workspace
version: 0.0.0
dependencies:
  codeql/cpp-all: ^4.3.1

The Issue:
When we do not open the codeql-pack.yml file (Pack Mode inactive), the server reports diagnostics correctly (e.g., "could not resolve module cpp" or syntax errors). However, we no other solution like qlpack.yml was working to correctly point the language server to standard library location, even with --search-path or putting the search path explicitly in initializationOptions

However, as soon as we do open the codeql-pack.yml file (Pack Mode active), the server stops reporting ALL diagnostics for subsequently opened query files.

  • Semantic errors (e.g., import non_existent_module) -> 0 diagnostics
  • Syntax errors (e.g., select 1 +) -> 0 diagnostics

Observations:

  • The server does not send any workspace/configuration requests to the client.
  • The server does not send any client/registerCapability requests.
  • Providing a valid database path in initializationOptions does not resolve the issue.
  • The didOpen for the pack file appears to successfully load the dependencies (because the "unresolved module" error disappears), but it seems to put the diagnostic engine into a silent state.

Question:
Is there a specific LSP notification, configuration option, or initialization parameter required to re-enable continuous diagnostic reporting (--check-errors=ON_CHANGE) after a QL pack has been loaded?

Technical Context:

CodeQL CLI Version: 2.20.1 (implied from dependencies)
Transport: Stdio with JSON-RPC 2.0
OS: Windows 11
Arguments: codeql execute language-server --check-errors=ON_CHANGE -v

Thanks for your time!
Rajat

Lingua principale
TypeScript
Stelle
539
Fork
240
Merge medio
2g 6h
PR unite (30g)
29

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/vscode-codeql

Tutte le issue di github/vscode-codeql

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.