Skip to content

evyatar9/ExplainThisCode

Repository files navigation

ETC (Explain This Code)

ExplainThisCode is A VSCode extension that uses the ChatGPT API to provide explanations for selected code.

explain-this-code.gif

Features

  • The extension will explain the selected code in your VSCode editor and insert the explanation as a block comment above the code.

  • Run this extension using one of the following methods:

    • Keyboard shortcut:

      1. Windows and Linux: Ctrl + Alt + E
      2. macOS: Ctrl + Cmd + E
    • ETC command in the command palette.

Requirements

Installation

There are two ways to install this extension:

  • From the Extension Marketplace: To install this extension from the Extension Marketplace in Visual Studio Code, search for ExplainThisCode and click the Install button.

  • Manually using a .vsix file: To install this extension manually using a .vsix file, follow these steps:

    1. Download the .vsix file from the releases page on GitHub Releases

    2. In Visual Studio Code, open the Command Palette (Ctrl+Shift+P)

    3. Select "Extensions: Install from VSIX..." and select the .vsix file you just downloaded.

Extension Settings

  • explainThisCode.apiKey: ChatGPT API key to use with the extension.

To set the value of the explainThisCode.apiKey extension setting:

  1. Open the settings editor by selecting the File menu, then Preferences and then Settings, or by using the keyboard shortcut Ctrl + , (Windows) or Command + , (Mac).

  2. In the search bar at the top of the editor, search for explainThisCode.apiKey.

  3. Click on the explainThisCode.apiKey setting and enter your ChatGPT API key in the input field provided.

  4. Click the Save button to save your changes.

Alternatively, you can also set the value of the explainThisCode.apiKey setting using the set() function of the ConfigurationChangeEvent class. For example:

vscode.workspace.getConfiguration().update('explainThisCode.apiKey', 'my-api-key', vscode.ConfigurationTarget.Global);

This will set the value of the explainThisCode.apiKey setting to 'my-api-key' for all workspaces.

Release Notes

2.0.0

  • GPT-4 Integration: Benefit from the latest advancements in natural language processing, providing even more insightful and accurate code explanations.

1.0.0

  • Initial release of the ETC extension.

Credits

License

This extension is licensed under the MIT License.

Contact

Telegram: @evyatar9

Discord: evyatar9

Support

You can support my work buying me a coffee:

buymeacoffe

Contributing

If you would like to contribute to the ETC extension, feel free to submit a pull request or report any issues you encounter on the ExplainThisCode repository.

Stargazers over time

Stargazers over time

About

ETC(ExplainThisCode) is A VSCode extension that uses the ChatGPT API to provide explanations for selected code.

Topics

Resources

Stars

Watchers

Forks