Function headers in source tree.
Hi is it possible to add function headers in the source tree. By function headers i mean only the first line of the function with contains the name, arguments and return type. This will utilize less tokens and help give the LLM an overview of the source code.
Aider does this using tree sitter: https://aider.chat/2023/10/22/repomap.html
Hi @mercurial-moon,
This is a really interesting idea and would definitely be valuable. A modular approach might make sense here, since each programming language has its own parsing rules, type systems, and module/import resolution quirks. That said, it’s a challenging problem to solve in a general way.
Tree-sitter seems like a promising foundation for this kind of functionality, since it already provides language-specific parsers. The question then is how best to integrate it into Code2Prompt ? I'm not sure if it would fit as a module inside code2prompt or as another crate.
In any case, I agree it would be awesome !