Files
nexus/wiki/sources/lsp-index-engineer.md
2026-04-21 00:02:55 +08:00

3.6 KiB
Raw Blame History

title, type, tags, date
title type tags date
LSP/Index Engineer source
agent
lsp
code-intelligence
2026-04-20

Source File

Summary

  • 核心主题LSP/Index Engineer 智能体角色定义专注于语言服务器协议LSP客户端编排和统一代码语义图谱构建
  • 问题域:异构语言服务器整合、实时语义索引构建、跨语言代码智能查询
  • 方法/机制:通过 LSP 客户端编排将 TypeScript/PHP/Go/Rust/Python 等语言服务器响应转换为统一图谱,使用 WebSocket 实现实时增量更新
  • 结论/价值:实现 <500ms 的定义/引用/悬停响应,支持 100k+ 符号规模,构建统一代码智能基础设施

Key Claims

  • graphd LSP Aggregator 通过并发编排多个 LSP 客户端实现异构语言服务器统一管理
  • 语义索引基础设施nav.index.jsonl、LSIF实现代码导航和文档的持久化
  • 增量更新机制通过文件监视器和 git hooks 实现图谱实时同步
  • 性能目标:/graph 端点 <100ms<10k 节点),/nav/:symId <20ms缓存或 <60ms未缓存

Key Quotes

"You transform heterogeneous language servers into a cohesive semantic graph that powers immersive code visualization."

"Every symbol must have exactly one definition node" — 图谱一致性要求

"Handle 25k+ symbols without degradation (target: 100k symbols at 60fps)" — 性能目标

Key Concepts

Key Entities

  • graphd:核心 LSP 聚合守护进程,管理多语言 LSP 客户端和图谱状态
  • TypeScript Language ServerTypeScript 语言服务器,提供 TS/JS 代码智能
  • IntelephensePHP 语言服务器,提供 PHP 代码智能
  • goplsGo 语言服务器,提供 Go 代码智能
  • rust-analyzerRust 语言服务器,提供 Rust 代码智能
  • pyrightPython 语言服务器,提供 Python 代码智能

Connections

Contradictions

  • 无冲突

Technical Architecture

Graph Node Schema

  • file:<path>:文件节点
  • sym:<name>符号节点class/function/variable/type

Graph Edge Types

  • contains:文件包含符号
  • imports:导入关系
  • extends/implements:继承/实现
  • calls:函数调用
  • references:符号引用

Navigation Index Format (nav.index.jsonl)

{"symId":"sym:AppController","def":{"uri":"file:///src/app.php","l":10,"c":6},"refs":[...],"hover":{...}}

Performance Contracts

Endpoint Target Latency Condition
/graph <100ms <10k nodes
/nav/:symId <20ms cached
/nav/:symId <60ms uncached
WebSocket events <50ms latency
Memory <500MB typical project