AHMDev Language Support for Visual Studio Code
Persian and English language support and an integrated run workflow for AHMDev source files (.AHMDev).
Features
- Automatic language detection for
.AHMDev files.
- Persian and English syntax highlighting.
- Highlighting for strings, escapes, comments, numbers, constants, operators and punctuation.
- Bilingual snippets for common program structures.
- Keyword and built-in function completion.
- Run File command, editor toolbar button, status-bar button and
Ctrl+F5 (Cmd+F5 on macOS).
- Check File command with syntax diagnostics in the Problems panel and
Ctrl+Shift+F5.
- Integrated terminal execution, including support for interactive
input().
- Automatic fallback from the
ahm executable to python -m ahmdev.
Requirements
- Visual Studio Code 1.80 or newer.
- AHMDev 2.18 installed in the selected Python environment, or the
ahm CLI available on PATH.
- Python 3.10+ when using the Python fallback.
Install AHMDev runtime
From the repository root:
python -m pip install ./2.18
If your system uses python3 or the Windows Python launcher, adjust the command accordingly.
Verify the installation:
ahm --version
If the ahm command is not on PATH, set AHMDev: Python Path to the Python executable where AHMDev was installed. The extension will then run python -m ahmdev.
Use the extension
- Open the
editors/vscode directory in VS Code, or install the packaged VSIX.
- Open a
.AHMDev file.
- Press
Ctrl+F5 / Cmd+F5, click the Run icon in the editor title, or run AHMDev: Run File from the Command Palette.
- The integrated terminal opens and displays the program output. Programs using
input() can receive input there.
- Run AHMDev: Check File or press
Ctrl+Shift+F5 to validate syntax without executing the program. Errors with line and column information appear in Problems.
Open Settings and search for AHMDev:
| Setting |
Default |
Purpose |
ahmdev.cliPath |
ahm |
Path to the AHMDev CLI executable |
ahmdev.pythonPath |
python |
Python executable for python -m ahmdev fallback |
ahmdev.clearDiagnosticsOnRun |
true |
Clear old diagnostics before running |
ahmdev.showRunTerminal |
true |
Reveal the integrated terminal when running |
You can also use AHMDev: Select CLI from the Command Palette to configure the CLI or Python executable.
Development
cd editors/vscode
npm test
npm run check
npx --yes @vscode/vsce package
To debug the extension itself, open editors/vscode and press F5 to launch an Extension Development Host. Inside that host, open a .AHMDev file and use Ctrl+F5 to run it.
Snippets
| Prefix |
Inserts |
ahm-main-en |
English hello-world program |
ahm-main-fa |
برنامهٔ سلام فارسی |
ahm-fn |
Function declaration |
ahm-if |
if/else block |
ahm-for |
for/in loop |
ahm-while |
while loop |
ahm-array |
Array literal |
ahm-dict |
Dictionary literal |
Build a VSIX package
Requirements: Node.js 20+ and npm.
npx --yes @vscode/vsce package
Install the generated VSIX with Extensions: Install from VSIX... in the Command Palette.
Marketplace publishing
The Marketplace publisher ID configured in this manifest is ahm. The publisher with this exact ID and its publishing credentials must be available before publishing.
The repository workflow packages the VSIX automatically. Marketplace publishing requires a configured Trusted Publishing policy for this repository and workflow.
License
MIT. See LICENSE.