Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>HCodeNew to Visual Studio Code? Get it now.
HCode

HCode

Utkarsh Pandey Prg

|
1 install
| (0) | Free
Add Hinglish comments into C, C++, Java, and Python code with Gemini directly inside VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HCode VS Code Extension

VS Code extension version of the existing Python CLI project for adding Hinglish comments directly into C, C++, Java, and Python code with Gemini.

Features

  • Comment selected code or the full active file
  • Clickable status bar button for one-click use on supported files
  • Editor title buttons so you can run HCode directly from the editor toolbar
  • Branded HCode sidebar in the Activity Bar with a richer action panel
  • Supports cpp, c, java, and python
  • Prompts for:
    • language: cpp, c, java, python
    • mode: function, line, full
    • style: simple, teaching, interview
  • Replaces the same code in the editor with commented code returned by Gemini
  • Optional preview command before replace
  • Optional copy-to-clipboard flow
  • Reads Gemini API key from VS Code settings or environment variables
  • Wraps long // comments so Hinglish text stays readable
  • Uses the VS Code clipboard API, which handles Unicode well on Windows

Important Behavior

The prompt is designed to keep Gemini on a very strict contract:

  • return only code
  • keep the same language
  • preserve original logic
  • only add comments
  • do not return markdown fences

The extension expects Gemini to return the same source code with comments inserted into that code.

Commands

  • HCode: Comment Selected Code
  • HCode: Comment Current File
  • HCode: Preview Commented Code
  • HCode: Copy Commented Code

Click-First Usage

You do not need to open the Command Palette.

  • Open a .cpp, .c, .java, or .py file
  • Click the HCode button in the status bar for the fastest flow
  • Or click the HCode buttons in the editor toolbar
  • Or click the HCode icon in the Activity Bar and use the sidebar panel

Comment Selected Code uses the current selection when present. If nothing is selected, it falls back to the full file and tells you.

Comment Current File always transforms the whole active document.

Preview Commented Code and Copy Commented Code follow hcpp.useSelectionIfAvailable.

Settings

{
  "hcpp.geminiApiKey": "",
  "hcpp.model": "gemini-2.5-flash",
  "hcpp.temperature": 0.2,
  "hcpp.useSelectionIfAvailable": true
}

API key lookup order:

  1. hcpp.geminiApiKey
  2. GEMINI_API_KEY
  3. GOOGLE_API_KEY

Installation

  1. Install the extension from the VS Code Marketplace or install the .vsix package.
  2. Set your Gemini API key in VS Code settings or environment variables.
  3. Open a .cpp, .c, .java, or .py file.
  4. Click HCode in the status bar, use the editor toolbar, or open the HCode sidebar.

Usage

  1. Select code, or leave nothing selected to use the full file.
  2. Run HCode: Comment Selected Code or HCode: Comment Current File.
  3. Choose language, mode, and style from Quick Picks.
  4. Wait for Gemini to return the updated code.
  5. The extension replaces the selected range or the full document with the commented result.

After replacement, you can also copy the generated result from the success notification.

Install Notes

  • Users do not need npm install
  • Users do not need npm run compile
  • The uploaded extension runs from the bundled compiled files

Notes and Limitations

  • Long comment wrapping currently targets // for C-family languages and # for Python.
  • Markdown fences are stripped if Gemini returns them anyway, but the prompt strongly instructs Gemini not to add them.
  • The wrapper uses lightweight line scanning for // comments and may not perfectly reflow every unusual edge case involving comment-like text inside strings.
  • The original Python CLI project is intentionally left untouched in its own workspace.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft