https://marketplace.visualstudio.com/items?itemName=JeffreyE...
I built this because I realized I was wasting a huge amount of time doing it manually. When I'm first starting on a coding project, and there are only a handful of code files (and none of them are particularly long), I like to give the full project code to the LLM in order to check it over or to ask it to modify something or to add a new feature. So I was constantly writing a short preamble to explain that the following was Python code or whatever, and then for each code file, I would include the relative path to the file, followed by a markdown code block (enclosing the code file contents in 2 pairs of ``` characters) with the file contents, with a separator between code files of ---.
I ended up just keeping that prompt in a separate text editor window and whenever I would update any part of the code, I'd manually modify that separate prompt file. It worked, but was still annoyingly manual. With this new extension, you can just open the VSCode command palette, type in "prepare" to find it (short for "Prepare for LLM"), and get a convenient interface for selecting the code files you want to include in your prompt. It remembers your file selections for the next time, and also includes a handy token counting feature that shows how many tokens each code file would use. It then keeps track in the status bar at the bottom of how many remaining tokens you could fit in your prompt (you can update this Max Tokens parameter easily depending on whether you are using regular ChatGPT4 with ~4000 token context window, or another model with smaller or larger context window).
It tries to be smart about caching the token counts and only updating them when the files are changed, and also filtering out non-code files and files that are excluded in your .gitignore file. Anyway, I hope you find it useful, and please let me know if you have any feedback.
Now that I know how to make extensions, I'm planning to make another one next for debugging a single code file with an LLM that would take the code file and then include each line with a "problem" in it (from a linter or something like Rust Analyzer) and the problem description-- another task that I waste tons of time on doing manually.