Entity-level code map via sem (Rust-native, for templates + token savings)
已经有一个关联 PR 被合并了。
- #321 来自 @rs545837 —— 已合并
评估
调研方向
先阅读 code2prompt 的模板和源代码树实现,然后查看 sem-core 的实体提取接口或 CLI sem entities --json。确定可选的 entity-map 模板变量应如何表示每个文件中的函数、类和方法。完成标准是:模板可以请求该结构,而无需包含每个完整的源文件。
由索引模型根据 Issue 内容生成。
描述
code2prompt's templating + source tree is a great base. A natural addition: an entity-level code map (functions, classes, methods per file) as a template variable, so prompts can include structure without dumping every full file, cutting tokens while improving navigation.
Since code2prompt is Rust, this is especially clean: sem is also Rust and exposes a sem-core crate (entity extraction across 26 languages via tree-sitter), so it can integrate as a library rather than a subprocess. There's also a CLI (sem entities <path> --json) if you'd prefer that path.
I maintain sem and would be glad to send a PR adding an optional entity-map variable. Would that fit the project?
- 主要语言
- Rust
- 星标
- 7.8k
- 派生
- 459
- 平均合并
- 3 天 20 小时
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mufeedvh/code2prompt 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
mufeedvh/code2prompt#355 ·
-
Symlink-to-file inside scanned root reads file content outside the root without --follow-symlinks未关闭
难度 2/5 1-3 小时 新手友好度 72/100
mufeedvh/code2prompt#354 ·
-
No tag 4.3.0未关闭
难度 1/5 1 小时以内 新手友好度 72/100
mufeedvh/code2prompt#340 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 62/100
mufeedvh/code2prompt#356 ·
-
难度 3/5 1-2 天 新手友好度 66/100
mufeedvh/code2prompt#352 · 1 条评论 ·
查看 mufeedvh/code2prompt 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
topgrade-rs/topgrade#2540 ·
维护者通常 1 天内回复
-
Invalid JSON options for ngram and edge_ngram silently use defaults可能已有人在做 @Tilendlesa 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
noemaforge/vimanam#153 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复