Pro Coder
A Visual Studio Code extension that uses OpenAI GPT models to fix bugs in your code and complete any missing blocks.
Usage
Below are two methods to run the extension on your code:
- Run the command from the VSCode command palette: "Complete Code and Fix Bugs"
- Run using the keyboard shortcut (when the editor pane is active) Cmd+Enter or Ctrl+Enter.
Examples
Fixing Bugs
Some bad code:
def sum(a: str, b:int) -> int:
After running the keyboard shortcut, the code was edited to the following:
def sum(a: int, b:int) -> int:
return a + b
Completing Code
After running the code completion command, the following code:
const encryptString = (stringToEncrypt: string) => {};
Was updated to the following:
const encryptString = (stringToEncrypt) => {
const stringToEncryptArray = stringToEncrypt.split('');
const encryptedStringArray = stringToEncryptArray.map((char) => {
const charCode = char.charCodeAt(0);
const encryptedCharCode = charCode + 1;
const encryptedChar = String.fromCharCode(encryptedCharCode);
return encryptedChar;
});
const encryptedString = encryptedStringArray.join('');
return encryptedString;
};
And using the function generated:
console.log(encryptString('Fix my code!')); // Gjy!nz!dpef"
Extension Settings
This extension contributes the following settings:
procoder.openAISecret
: Your OpenAI API key.
procoder.model
: The OpenAI model to use. Make sure the model name you enter is compatible with the completion type selected, otherwise a 404 error will be returned.
procoder.temperature
: The creativity of the model edits.