gencay / vscode-chatgpt

An unofficial Visual Studio Code - OpenAI ChatGPT integration
ISC License
3.5k stars 760 forks source link

Always format code as code when using the "Continue" prompt #128

Closed kristofferR closed 1 year ago

kristofferR commented 1 year ago

The continue prompt is suboptimal for me - if ChatGPT stops generating code in the middle of certain code, like a comment block for example, the next part is often given as regular text instead of a code block, meaning that the responses can't be combined:

Screenshot 2023-02-12 at 10 15 17

It would be nice if this plugin could detect that and force the text to be formatted as code.

Trahloc commented 1 year ago

Yeah this happens a lot unfortunately. Once we gain the ability to modify the default requests we can start crowdsourcing the best way to ask these things. Like the person that did the 20 line segment trick.

kristofferR commented 1 year ago

There you can only change the prompts, not the name of the prompts.

Trahloc commented 1 year ago

Yeah I figured that out a minute too late. lame am I.

gencay commented 1 year ago

Are you able to consistently reproduce this for a prompt? I see this from time to time as well. The reason is that OpenAI doesn't send the response in the correct markdown format (e.g. the code block needs to be fenced with ```) for the extension to render it in code block unfortunately. Without the proper fencing in markdown, there isn't anything the extension do. Don't expect a perfect solution like OpenAI's web experience, they own both frontend and backend there.

This extension is not affiliated with anywhere, it's just a hobby project I work on, on my free time to learn gpt stuff and writing extensions in vs code for the community for free..

I am happy to look into if there is a concise reproducible way to understand the issue better.