Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>ExplainThisCodeNew to Visual Studio Code? Get it now.
ExplainThisCode

ExplainThisCode

evyatar9

|
566 installs
| (1) | Free
ExplainThisCode is A VSCode extension that uses the ChatGPT API to provide explanations for selected code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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

  • A ChatGPT API key is required to use this extension.

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 Support.

1.0.0

  • Initial release of the ETC extension.

Credits

  • ChatGPT API: https://openai.com/docs/api-reference/overview/

License

This extension is licensed under the MIT License.

Contact

Telegram: @evyatar9

Discord: evyatar9#5800

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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft