Coding GPTCoding GPT is a Visual Studio Code extension that allows you to generate test cases, refactor code, find issues, and explain code selections using the CODING GPT. This extension provides a set of commands that can be accessed through the command palette or the editor context menu. CommandsAdd API TokenTo use the CODING GPT, you need to add your API token. To do this, use the "CODING GPT: Add API Token" command. This will prompt you to enter your API token. Generate API Token:
Example to add it to extension:
ChatThe "CODING GPT: Chat" command opens a webview that allows you to chat with the CODING GPT using the GPT-3.5-Turbo API. This feature allows you to have a conversation with the CODING GPT and get responses to your questions or requests. UsageTo use the "CODING GPT: Chat" command, follow these steps:
Chatting with the CODING GPTOnce the webview is open, you can start chatting with the CODING GPT. Simply type your message in the input field at the bottom of the webview and press enter to send it. The CODING GPT will then generate a response based on your message using the GPT-3.5-Turbo API. You can continue the conversation by typing your next message in the input field and pressing enter. The CODING GPT will respond to each message you send. Send MessageTo send a message to the CODING GPT, use the "CODING GPT: Send Message" command. This will prompt you to enter the message you want to send. Example:
Refactor CodeTo refactor your code using the CODING GPT, use the "CODING GPT: Refactor Code" command. This will prompt you to select the code you want to refactor. The CODING GPT will then generate a refactored version of the code. Example:
Enzyme TestsTo generate Enzyme tests using the CODING GPT, use the "CODING GPT: Enzyme Tests" command. This will prompt you to select the code you want to test. The CODING GPT will then generate a set of Enzyme tests for the selected code. Example:
React Testing Library TestsTo generate React Testing Library tests using the CODING GPT, use the "CODING GPT: React Testing Library Tests" command. This will prompt you to select the code you want to test. The CODING GPT will then generate a set of React Testing Library tests for the selected code. Example:
ExplainTo get an explanation of a code selection using the CODING GPT, use the "CODING GPT: Explain the Selection" command. This will prompt you to select the code you want to explain. The CODING GPT will then generate an explanation of the selected code. Example:
Find the IssueTo find an issue in your code using the CODING GPT, use the "CODING GPT: Find the Issue" command. This will prompt you to select the code you want to check for issues. The CODING GPT will then generate a report of any issues found in the selected code. Example:
ConfigurationThe Coding GPT extension provides additional configuration options that allows you to set the path to your ESLint config and allow you to adjust the randomness of the output and the maximum number of tokens to be generated in the completion. To access these configurations, go to the "Coding GPT" section in your Visual Studio Code settings. The "codingGPT.temperature" property allows you to set the randomness of the output. The default value is 0, which generates a deterministic output. A higher value between 0 and 1 generates more random outputs. The "codingGPT.maxTokens" property allows you to set the maximum number of tokens to be generated in the completion. The default value is 2048, with a valid range of 256 to 2048 tokens. Increasing this value allows for longer and potentially more complex completions. ConclusionWith the Coding GPT extension, you can easily generate test cases, refactor code, find issues, and explain code selections using the CODING GPT. This extension is a powerful tool for developers who want to improve their coding workflow and productivity. |