feat: add experimental support for AST parsing and static graph indexing

- Introduced CLI options for using AST grep parsers and enabling static graph relationships during indexing.
- Updated configuration management to load new settings for AST parsing and static graph types.
- Enhanced AST grep processor to handle imports with aliases and improve relationship tracking.
- Modified TreeSitter parsers to support synthetic module scopes for better static graph persistence.
- Implemented global relationship updates in the incremental indexer for static graph expansion.
- Added new ArtifactTag and FloatingFileBrowser components to the frontend for improved terminal dashboard functionality.
- Created utility functions for detecting CCW artifacts in terminal output with associated tests.
This commit is contained in:
catlog22
2026-02-15 23:12:06 +08:00
parent 48a6a1f2aa
commit 8938c47f88
39 changed files with 2956 additions and 297 deletions

View File

@@ -125,6 +125,13 @@ CODEXLENS_DEBUG=false
"tool": "gemini",
"timeout_ms": 300000,
"batch_size": 5
},
"parsing": {
"use_astgrep": false
},
"indexing": {
"static_graph_enabled": false,
"static_graph_relationship_types": ["imports", "inherits"]
}
}
```
@@ -167,6 +174,32 @@ CODEXLENS_DEBUG=false
| `timeout_ms` | int | 超时时间 (毫秒) |
| `batch_size` | int | 批处理大小 |
### Parsing 设置
| 字段 | 类型 | 说明 |
|------|------|------|
| `use_astgrep` | bool | 优先使用 ast-grep 解析关系(实验性;当前主要用于 Python relationships |
### Indexing 设置(静态图)
| 字段 | 类型 | 说明 |
|------|------|------|
| `static_graph_enabled` | bool | 索引时将 relationships 写入全局 `global_relationships`,用于搜索阶段静态图扩展 |
| `static_graph_relationship_types` | array | 允许持久化的关系类型:`imports` / `inherits` / `calls` |
**CLI 覆盖(单次运行,不写入 settings.json**:
```bash
# 索引时启用静态图 relationships + 使用 ast-grep如果可用
codexlens index init --use-astgrep --static-graph --static-graph-types imports,inherits,calls
```
**Search staged 静态图扩展(高级)**:
```bash
codexlens search --cascade-strategy staged --staged-stage2-mode static_global_graph
```
## FastEmbed 模型配置文件
使用 `fastembed` 后端时的预定义模型: