-
Notifications
You must be signed in to change notification settings - Fork 1
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-java | scip-java docs (Gradle plugin required) |
| Rust | rust-analyzer | rust-analyzer docs |
| C/C++ | scip-clang | scip-clang releases |
| Dart | scip_dart |
dart pub global activate scip_dart (note: underscore, not hyphen) |
| Ruby | scip-ruby | scip-ruby docs |
| C# | scip-dotnet | scip-dotnet docs (.NET 8+) |
| PHP | scip-php | scip-php docs (PHP 8.2+) |
Run ckb index to auto-detect your language and run the appropriate indexer.
CKB classifies languages into quality tiers based on indexer maturity, known issues, and accuracy metrics. This helps you understand what to expect from each language.
| Tier | Guarantee | Languages |
|---|---|---|
| Tier 1 (Full) | Full support, all features, stable | Go |
| Tier 2 (Standard) | Full support, known edge cases | TypeScript, JavaScript, Python |
| Tier 3 (Basic) | Basic support, callgraph may be incomplete | Rust, Java, Kotlin, C++, Ruby, Dart |
| Tier 4 (Experimental) | Experimental, use with caution | C#, PHP |
Go (Tier 1)
- No known issues
- Full support with scip-go
TypeScript/JavaScript (Tier 2)
- Monorepo with multiple tsconfig may need
--infer-tsconfig - Path aliases require tsconfig.json
- Dynamic imports may not be tracked
- CommonJS
require()patterns may have incomplete resolution
Python (Tier 2)
- Virtual environments must be activated or detected
- Dynamic imports (
importlib) not tracked - Type stubs may not be fully resolved
Rust (Tier 3)
- Macro expansions may have incomplete references
- Proc macros may not be fully analyzed
Java/Kotlin (Tier 3)
- Gradle projects may need build task first
- Annotation processors may have incomplete resolution
- Kotlin extension functions may have incomplete resolution
C++ (Tier 3)
- Requires
compile_commands.json - Templates may have incomplete resolution
- Macros can affect accuracy
Ruby (Tier 3)
- Sorbet types improve accuracy
- Metaprogramming may not be tracked
Dart (Tier 3)
- Flutter projects need
flutter pub getfirst
C# (Tier 4)
- Requires .NET 8+ SDK
- Source generators may have incomplete resolution
PHP (Tier 4)
- Requires PHP 8.2+
- Dynamic calls may not be tracked
Use the /meta/languages endpoint to get quality metrics for your project:
curl http://localhost:8080/meta/languagesResponse includes:
- tier: 1-4 rating based on language maturity
-
quality:
ok,degraded,partial, orunknown - refAccuracy: Estimated reference accuracy (0-1)
- callGraphQuality: Call graph completeness
- knownIssues: Language-specific issues to watch for
- recommendations: Suggestions to improve quality
CKB detects Python virtual environments to provide better recommendations:
curl http://localhost:8080/meta/python-envIf no venv is active, CKB will recommend activating one before indexing:
source .venv/bin/activate && ckb index
CKB detects TypeScript monorepo configurations:
curl http://localhost:8080/meta/typescript-monorepoDetects:
- pnpm workspaces (
pnpm-workspace.yaml) - Yarn/npm workspaces (
package.jsonwithworkspaces) - Lerna (
lerna.json) - Nx (
nx.json) - Per-package tsconfig status
For monorepos, CKB recommends using scip-typescript --infer-tsconfig.
Real-time analysis via language server or tree-sitter. 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 Standard:
- 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 Fast 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 Fast:
- 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 | Standard | Fast | 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 -- makeThe compilation database is typically created in build/ or similar. CKB searches common locations automatically.
Then run: scip-clang --compdb-path=build/compile_commands.json
Note: scip-clang must run from the project root directory, even if compile_commands.json is in a subdirectory.
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 Standard tier:
Backends:
SCIP: available (47,832 symbols indexed)
LSP: available (go language server)
Git: available (1,247 commits)
Example output for Fast tier:
Backends:
SCIP: not available (run 'ckb index' to generate)
LSP: available (typescript-language-server)
Git: available (892 commits)
Use ckb doctor --tier to check if your environment is ready for a specific analysis tier:
# Check enhanced tier requirements
ckb doctor --tier enhanced
# Check full tier requirements (SCIP + LSP)
ckb doctor --tier fullExample output:
CKB Doctor - Enhanced Tier Requirements
=============================================
Go: Y Ready
Y scip-go v1.0.0
TypeScript: N Not Ready
N scip-typescript not found
Suggested install: npm install -g @sourcegraph/scip-typescript
Summary: 1/2 languages ready for enhanced tier.
What it shows:
- Which tools are installed for each detected language
- Tool versions and paths
- Missing tools with install commands
- Per-language tier status (ready or not ready)
Tier names: You can use either naming convention:
-
basicorfast— Tree-sitter only -
enhancedorstandard— SCIP indexers -
full— SCIP + LSP servers
This is useful when setting up a new machine or troubleshooting why certain capabilities aren't available.
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 | Standard | You're all set |
| Indexer available, not installed | Fast | Run ckb index
|
| No indexer, but LSP available | Fast | 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 Standard tier automatically.
- Quick-Start — Installation and initial indexing
- Configuration — Language-specific settings
- Practical-Limits — Accuracy by language
- Architecture — Backend selection