Update nexus wiki content
This commit is contained in:
39
wiki/concepts/LSIF.md
Normal file
39
wiki/concepts/LSIF.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: "LSIF"
|
||||
type: concept
|
||||
tags: ["LSP", "code-index", "semantic-index", "static-analysis", "pre-computed"]
|
||||
sources: ["lsp-index-engineer.md"]
|
||||
last_updated: 2026-04-29
|
||||
---
|
||||
|
||||
## Definition
|
||||
LSIF(Language Server Index Format)是一种标准化的预计算语义索引格式,用于存储语言服务器已分析过的代码语义数据(如符号定义、引用、继承关系等),使代码智能工具无需实时运行 LSP 服务器即可提供导航功能。
|
||||
|
||||
## Core Mechanism
|
||||
|
||||
### 用途
|
||||
- **离线索引**:项目提前构建 LSIF 索引,CI/CD 阶段预先生成
|
||||
- **冷启动加速**:无需等待 LSP 服务器初始化,立即提供代码导航
|
||||
- **分发预索引数据**:发布 npm 包时附带已编译的 LSIF 索引
|
||||
- **跨工具共享**:同一索引可为多个工具(IDE/CLI/API)共用
|
||||
|
||||
### 索引内容
|
||||
- 符号定义位置
|
||||
- 符号引用关系
|
||||
- 文档结构(文件树/大纲)
|
||||
- Hover 文档内容
|
||||
- 类型层次信息
|
||||
|
||||
### 与 nav.index.jsonl 的关系
|
||||
LSIF 是 nav.index.jsonl 格式的导入/导出标准。graphd 支持:
|
||||
- **导出**:将内存中的语义图谱导出为 LSIF 格式
|
||||
- **导入**:将预先构建的 LSIF 索引加载到内存,加速启动
|
||||
|
||||
## Implementation Notes
|
||||
LSP/Index Engineer 将 LSIF 视为 nav.index.jsonl 格式的上游标准,通过 LSIF 实现预计算语义数据的导入/导出。
|
||||
|
||||
## Connections
|
||||
- [[LSIF]] ← is_standard_for ← [[SemanticCodeGraph]]
|
||||
- [[LSIF]] ← can_be_imported_by ← [[GraphDaemon]]
|
||||
- [[LSIF]] ← is_alternative_to ← [[IncrementalGraphUpdate]]
|
||||
- [[LSIF]] ← exports ← [[nav.index.jsonl]]
|
||||
Reference in New Issue
Block a user