This plugin generates code and documentation using ChatGPT API based on the code description given by the user.
✅ Generate code based on the user-provided code description.
✅ Generate a doc comment for the current function.
✅ Generate a summarized comment for the selected block of code.
To use PHP AI code, you'll need to install it as a plugin in your IntelliJ editor (PHPStorm). Here are the steps:
- Go to
Settings
->Plugins
->Marketplace
in your IntelliJ editor. - Search for "PHP AI code" and click on the
Install
button. - Once the plugin is installed, restart IntelliJ IDEA editor to activate it.
- Retrieve your ChatGPT API key from OpenAI.
- Set the API Key in
Settings
->Tools
->PHP AI Code
To generate code using the plugin, follow these steps:
- Write a comment with a description of the code you want to generate.
- Place the cursor inside the comment.
- Execute the "Generate AI Code" plugin action by going to
Code
->Generate
or PressCtrl + N
(orCmd + N
on a Mac) and selectGenerate AI Code
from the menu. - The generated code will be inserted into your code editor after the comment.
Alternatively, you can select a code description and execute the Generate AI Code
plugin action. The generated code will replace the selected text.
If you execute the Generate AI Code
plugin action without any code description, a dialog will be displayed asking you to enter one.
To generate a doc comment for the current function, follow these steps:
- Place the cursor inside the function definition.
- Go to
Code
->Generate
or PressCtrl + N
(orCmd + N
on a Mac) and selectGenerate AI Comment
from the menu. - The generated doc comment will be inserted above the function definition.
To generate a summarized comment for the selected block of code, follow these steps:
- Select the code block you want to generate a summarized comment for.
- Go to
Code
->Generate
or PressCtrl + N
(orCmd + N
on a Mac) and selectGenerate AI Comment
from the menu. - The generated summarized comment will be inserted above the selected code block.
If you'd like to contribute to PHP AI Code, please feel free to submit a pull request. We welcome contributions of all types, from bug fixes to new features.
PHP AI Code is licensed under the MIT License. See the LICENSE
file for more information.
If you have any questions or feedback about PHP AI Code, please feel free to contact us at y.alhyane@gmail.com