CodeQL language support for coc.nvim: language server integration, filetype detection and tree-sitter highlighting
Published Package Summary
coc-codeql
CodeQL language support for coc.nvim — an editor companion to the CodeQL CLI, following the editing experience of the official vscode-codeql extension.
Features
- Language server integration — diagnostics, completion, hover,
definition, references, document symbols, formatting, rename and
inlay hints, with pack resolution through the qlpack and the package
cache (
codeql pack install) - Filetype detection for
*.ql/*.qll - Language configuration —
//line comments, block comment continuation, comment-awareformatoptions - Tree-sitter highlighting & folding
This extension is a pure editor integration: the language intelligence lives in the CodeQL CLI, the parser and highlight queries are provided by your editor's tree-sitter toolchain, and nothing is bundled here.
Requirements
- neovim ≥ 0.9 (developed and tested on 0.12)
- coc.nvim ≥ 0.0.82
- the CodeQL CLI ≥ 2.x on
PATH(or setcodeql.cliPath) - the
qltree-sitter parser, installed through the tree-sitter ecosystem:
:TSInstall ql
nvim-treesitter registers the tree-sitter-ql grammar and ships its queries. The revision currently pinned in nvim-treesitter's lockfile mis-parses
true()/false()(QL has no boolean literals); if that bites you, install a fixed parser build into your nvim site directory manually (:h treesitter-parsers). Without a parser, highlighting degrades gracefully with a warning; every other feature works.
Install
:CocInstall coc-codeql
Development
pnpm build # esbuild → lib/index.js (also runs on pnpm install)
pnpm watch # rebuild on change
pnpm typecheck # tsc --noEmit for src and tests
pnpm lint # eslint — errors on any @deprecated API usage
pnpm lint:md # markdownlint over all markdown files
pnpm check # typecheck + lint + lint:md
pnpm test # test/*.test.ts — the feature suite (coc-test)
pnpm test:variants # test/variants/* — configuration-variant suites
pnpm test:all # check + both test suites
The LSP suites skip when codeql is not on PATH. The highlighting
suites that need a real parser skip when none is found; point
COC_CODEQL_PARSER_DIR at a directory containing parser/ql.so and
queries/ql/ to provide one. test:variants injects settings before
activation through COC_CODEQL_SETTINGS
(see scripts/test-setup.mjs).
Roadmap
Measured against vscode-codeql's feature set (query execution, database management, variant analysis, …), this extension currently implements the language-editing foundation. Plans:
Editing experience
- Language server: diagnostics, completion, hover, definition, references, document symbols, formatting, rename
- Syntax highlighting & folding (tree-sitter)
- Filetype detection and language configuration
- Semantic tokens / richer highlighting from the server
- Inlay hints exposure (the server supports them; coc wiring needed)
Query development
- Run query against the current database
(
codeql query run/ the query server) - Quick evaluation of the selected predicate/expressions
- Results viewing (export to CSV/SARIF, a results buffer)
- Query history
-
.qltesttest running and output comparison
Database management
- Database selection UI (
:CocList-style picker) - Database overview (language, upgrade hints)
Workspace & packs
-
codeql pack install/ dependency management commands - qlpack-aware workspace features (smart workspace detection)
License
MIT
- CodeQL language support for coc.nvim: language server integration, filetype detection and tree-sitter highlighting
- *
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-codeql@0.1.0.
| Command (:CocCommand) | Description |
|---|---|
| codeql.restartLanguageServer | Restart the CodeQL language server |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "string",
"default": "codeql",
"description": "Path to the CodeQL CLI executable."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Start the CodeQL language server (diagnostics, completion, hover, definition)."
}Raw JSON Schema
{
"enum": [
"ON_CHANGE",
"EXPLICIT"
],
"type": "string",
"default": "ON_CHANGE",
"description": "When to check for QL errors."
}