Files
nexus/wiki/concepts/nav.index.jsonl.md
2026-05-03 05:42:12 +08:00

46 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "nav.index.jsonl"
type: concept
tags: ["code-navigation", "symbol-index", "LSP", "JSONL", "semantic-graph"]
sources: ["lsp-index-engineer.md"]
last_updated: 2026-04-29
---
## Definition
nav.index.jsonl 是 LSP/Index Engineer 定义的导航索引文件格式,以 JSONL每行一条 JSON 记录)流式存储每个符号的导航信息,用于快速符号查找和代码导航服务。
## Format Specification
### Symbol Definition Record
```jsonl
{"symId":"sym:AppController","def":{"uri":"file:///src/controllers/app.php","l":10,"c":6}}
```
记录符号定义位置:`symId`(符号唯一 ID`def.uri`(文件 URI`def.l`(行号)、`def.c`(列号)
### Symbol References Record
```jsonl
{"symId":"sym:AppController","refs":[
{"uri":"file:///src/routes.php","l":5,"c":10},
{"uri":"file:///tests/app.test.php","l":15,"c":20}
]}
```
记录符号所有引用位置
### Hover Documentation Record
```jsonl
{"symId":"sym:useState","hover":{"contents":{"kind":"markdown","value":"```typescript\nconst [state, setState] = useState()\n```\nReact state hook"}}}
```
记录符号的悬停文档内容
## Core Properties
- **流式写入**:每次增量更新追加新记录,无需全量重建
- **原子性更新**:确保图谱从不处于不一致状态
- **快速查询**:通过 symId 直接索引O(1) 查找
- **LSIF 兼容**:支持导入/导出 Language Server Index Format 预计算数据
## Connections
- [[nav.index.jsonl]] ← is_format_of ← [[SemanticCodeGraph]]
- [[nav.index.jsonl]] ← built_by ← [[GraphDaemon]]
- [[nav.index.jsonl]] ← uses ← [[IncrementalGraphUpdate]]
- [[nav.index.jsonl]] ← can_be_exported_as ← [[LSIF]]