Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature idea: Remove comments / minify code. #8

Open
arthurwolf opened this issue May 5, 2024 · 0 comments
Open

Feature idea: Remove comments / minify code. #8

arthurwolf opened this issue May 5, 2024 · 0 comments
Labels

Comments

@arthurwolf
Copy link

arthurwolf commented May 5, 2024

I think most modern LLMs should be able to understand code even without the comments (at least understand most of it).

This means in some cases, giving the comments along with the code is probably wasting tokens.

An option to remove the comments would help with providing even more code to LLMs (especially with the new "file select" feature).

Or one could try going even further and minifying the code, I'd be curious how well the LLM would handle that (I guess that could be tested manually, I'll do some tests next time I need to send large amounts of code).

Maybe even, one (configurable) feature that could work nicely with #6 is to remove comments/minify only when the token limit is reached: when the extension detects the token limit is reached, it removes comments one by one until removing one gets us below the token limit. And if it removes all the comments and we are still above the token limit, it starts minifying the files one by one. And if you want to get really crazy fancy, you can use a LLM (with a configured provided API key / API URL) to make decisions on which files to minify or not based on their filename and the rest of the prompt / the question the files are provided to help with, but that's a bit too crazy maybe :)

(again, amazing project, and really impressed by the reactivity to suggestions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants