No Diagnostics from CodeQL Language Server
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- devtools
Research direction
Reproduce the sequence with codeql execute language-server --check-errors=ON_CHANGE -v: initialize the workspace, open codeql-pack.yml, then open a .ql file containing syntax and semantic errors. Inspect the LSP notifications and initialization options around pack loading; done means identifying the required configuration or notification so diagnostics resume after the pack is opened.
Written by the indexing model from the issue text.
Description
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:
- Server Start:
codeql execute language-server --check-errors=ON_CHANGE -v - Initialization: Standard
initializerequest withrootUripointing to a workspace. - Pack Setup: We create a valid
codeql-pack.ymlin the workspace withdependencies: { codeql/cpp-all: "^4.3.1" }and runcodeql pack install. - Pack Loading: We send
textDocument/didOpenfor thecodeql-pack.ymlfile to trigger pack resolution (this successfully fixes "unresolved module" errors). - Query Opening: We send
textDocument/didOpenfor a.qlquery 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/configurationrequests to the client. - The server does not send any
client/registerCapabilityrequests. - Providing a valid
databasepath ininitializationOptionsdoes not resolve the issue. - The
didOpenfor 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
- Dominant language
- TypeScript
- Stars
- 539
- Forks
- 240
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 29
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/vscode-codeql
-
bug VSCode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/vscode-codeql#4471 · 1 comment ·
-
bug enhancement VSCode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/vscode-codeql#592 · 2 comments ·
-
enhancement VSCode
Difficulty 3/5 1-2 days Newbie friendliness 55/100
github/vscode-codeql#4432 · 1 comment ·
-
bug VSCode
Difficulty 3/5 1-2 days Newbie friendliness 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Difficulty 3/5 1-2 days Newbie friendliness 64/100
github/vscode-codeql#4339 · 1 comment ·
All issues in github/vscode-codeql
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100