rubberduck-vscode icon indicating copy to clipboard operation
rubberduck-vscode copied to clipboard

"Explain code" should explain the current file when no code is selected

Open AnthonyLenglet opened this issue 2 years ago • 2 comments

Is this request related to a problem? Please describe.

Currently, whenever you select the option "explain code", not selecting any code in the file gives you the error Variable 'selectedText' is too short, forcing you to select the entire file before asking for the AI to explain the entire code

Describe the solution you'd like

Whenever no code is selected, the selectedText variable should be equal to the entirety of the file currently in focus

AnthonyLenglet avatar Feb 07 '23 10:02 AnthonyLenglet

I agree. The reason selections are required at the moment is that the prompt input size is limited (4096 tokens - tokens reserved for the response), so you'd run into errors with larger files. But that could be solved with a different error message.

lgrammel avatar Feb 07 '23 10:02 lgrammel

https://github.com/rubberduck-ai/rubberduck-vscode/issues/119

trymeouteh avatar Mar 07 '24 17:03 trymeouteh