This is a Visual Studio Code extension that uses the OpenAI API to automatically generate comments for your code.
- Generate comments for selected code.
- Use the power of OpenAI's GPT-4 to understand your code and provide relevant comments.
- Install the extension from a generated
.vsixfile. - Once installed, you'll need to set the OpenAI API Key in the settings. Open your settings (File > Preferences > Settings) and set the
carcargi-comment-generator.openaiApiKeyto your OpenAI API key.
- Select the code you want to comment.
- Open the command palette with
Ctrl+Shift+PorCmd+Shift+Pon macOS. - Type 'Generate Comment' and hit enter.
This will generate a comment for your selected code and replace the code with the commented one. Keep in mind the token limit might cut long functions or portions of code.
Copyright (c) 2023
Permission is hereby granted, free of charge, to any person obtaining a copy of this software (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE AUTHORS AND COPYRIGHT HOLDERS TAKE NO RESPONSIBILITY FOR THE ACTIONS OR USAGE OF THE SOFTWARE BY USERS. USERS ARE SOLELY RESPONSIBLE FOR THEIR USE OF THE SOFTWARE AND THE SOURCE CODE.