|
|
|
|
|
by ghughes
1099 days ago
|
|
Cool project! I'm working in the same space (a ChatGPT plugin that can edit files within a shared VS Code workspace) and have built something similar to your "repo map" concept, except slightly lower-level: what you might call a "file map" generated by selectively collapsing AST nodes to fit within the available token budget. If ctags isn't cutting it for you, have a look at tree-sitter [1]. It can generate ASTs for most languages and has a nice API. [1] https://tree-sitter.github.io/tree-sitter/ |
|
I have been looking at tree-sitter quite a bit actually. I love that it has broad language support, which is a key design goal for my tool.
My only hesitation is that it doesn't appear to correctly identify multi-line function signatures & calls. If you look below at create, io.tool_error and __init__ you can see that the (row,col)-(row,col) indicies only reference the first line.
GPT would really benefit from seeing the entire function signature and call sites.