-
-
Notifications
You must be signed in to change notification settings - Fork 11
Language Support
CKB works with any language, but the depth of analysis varies based on available tooling.
CKB combines multiple sources of code intelligence:
| Source | What it provides | Speed |
|---|---|---|
| SCIP Index | Pre-computed symbol map with all definitions, references, and relationships | Instant |
| LSP | Real-time queries to a language server | Fast (may timeout on large queries) |
| Git | Blame, history, churn, ownership | Fast |
| Heuristics | File patterns, naming conventions, import scanning | Instant |
The SCIP index is the key differentiator. Languages with a SCIP indexer get precise, complete analysis. Languages without one fall back to LSP or heuristics.
Full code intelligence with precise, pre-computed data.
Features:
- Precise symbol search (no false positives)
- Complete reference finding
- Accurate call graphs (callers and callees)
- Impact analysis with confidence scores
- Dead code detection
- Symbol justification (keep/investigate/remove)
Languages:
| Language | Indexer | Install |
|---|---|---|
| Go | scip-go | go install github.com/sourcegraph/scip-go/cmd/scip-go@latest |
| TypeScript/JavaScript | scip-typescript | npm install -g @sourcegraph/scip-typescript |
| Python | scip-python | pip install scip-python |
| Java | scip-java | scip-java docs |
| Kotlin | scip-kotlin | scip-kotlin docs |
| Rust | rust-analyzer | rust-analyzer docs |
| C/C++ | scip-clang | scip-clang releases |
| Dart | scip_dart | dart pub global activate scip_dart |
| Ruby | scip-ruby | scip-ruby docs |
| C# | scip-dotnet | scip-dotnet docs |
| PHP | scip-php | scip-php docs |
Run ckb index to auto-detect your language and run the appropriate indexer.
Real-time analysis via language server. Good for navigation, but slower and less complete for large queries.
Features:
- Symbol search (may have gaps)
- Go to definition
- Find references (within open scope)
- Limited call graph support
Missing compared to Enhanced:
- Complete cross-file reference finding
- Accurate call graphs
- Impact analysis confidence
- Dead code detection
When you're in this tier:
- Language has an LSP server but no SCIP indexer
- SCIP indexer exists but isn't installed
- SCIP index wasn't generated yet
How to check: Run ckb status - if you see "SCIP: not available" but "LSP: available", you're in Basic tier.
File-based analysis using patterns and naming conventions. Works for any language but limited depth.
Features:
- Module detection (finds package boundaries)
- Import scanning (understands dependencies)
- File role classification (test, config, entrypoint)
- Architecture overview (module graph)
- Git-based features (ownership, hotspots, blame)
Missing compared to Basic:
- Symbol-level navigation
- Reference finding
- Call graphs
When you're in this tier:
- No SCIP indexer available
- No LSP server configured
- Unsupported or niche language
| Feature | Enhanced | Basic | Minimal |
|---|---|---|---|
| Symbol search | Precise | Partial | - |
| Go to definition | Yes | Yes | - |
| Find all references | Complete | Partial | - |
| Call graph | Yes | Limited | - |
| Impact analysis | High confidence | Low confidence | - |
| Dead code detection | Yes | - | - |
| Module detection | Yes | Yes | Yes |
| Architecture overview | Yes | Yes | Yes |
| Ownership (CODEOWNERS) | Yes | Yes | Yes |
| Ownership (git blame) | Yes | Yes | Yes |
| Hotspot detection | Yes | Yes | Yes |
| File role classification | Yes | Yes | Yes |
Configure an LSP server in .ckb/config.json:
{
"lsp": {
"servers": {
"your-language": {
"command": "your-language-server",
"args": ["--stdio"]
}
}
}
}- Install the SCIP indexer for your language (see table above)
- Run
ckb indexor the indexer directly - Verify with
ckb status
C++ requires a compilation database (compile_commands.json) because the indexer needs to know compiler flags, include paths, and preprocessor defines.
Generate it with:
# CMake
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B build .
# Meson
meson setup build
# Make (via Bear)
bear -- makeThen run: scip-clang --compdb-path=build/compile_commands.json
CKB supports one SCIP index per project. For polyglot repos:
- Index the primary language
- Other languages fall back to LSP or heuristics
- Git-based features (ownership, hotspots) work for all files
Future versions may support merging multiple SCIP indexes.
Generated files (protobuf, GraphQL, etc.) should be generated before indexing:
go generate ./...
ckb indexOtherwise generated symbols won't appear in the index.
# See what's available
ckb status
# Diagnose issues
ckb doctorExample output for Enhanced tier:
Backends:
SCIP: available (47,832 symbols indexed)
LSP: available (go language server)
Git: available (1,247 commits)
Example output for Basic tier:
Backends:
SCIP: not available (run 'ckb index' to generate)
LSP: available (typescript-language-server)
Git: available (892 commits)
If your language has a SCIP indexer that CKB doesn't know about:
- Run the indexer manually to generate
index.scip - CKB will detect and use it automatically
- Consider opening an issue to add it to
ckb index
If no SCIP indexer exists for your language:
- Check if one is in development: SCIP indexers
- Use LSP mode for now
- Consider contributing an indexer (see Writing an Indexer)
| Your situation | Tier | What to do |
|---|---|---|
| Indexer installed, index generated | Enhanced | You're all set |
| Indexer available, not installed | Basic | Run ckb index
|
| No indexer, but LSP available | Basic | Configure LSP in config |
| No indexer, no LSP | Minimal | Git features still work |
Most popular languages have SCIP indexers. Run ckb index and you'll likely get Enhanced tier automatically.