Language support for Calcpad (.cpd files) in Visual Studio Code.
Features
-
Syntax Highlighting - Full syntax highlighting for Calcpad files including:
- Keywords (#if, #else, #for, #while, #def, etc.)
- Methods ($Root, $Find, $Plot, $Integral, etc.)
- Built-in functions (sin, cos, sqrt, matrix, etc.)
- Numbers with units (10m, 5kg, 100Pa, etc.)
- Operators and special symbols
- Strings and comments
-
Auto-completion - IntelliSense completions for:
- All Calcpad keywords
- Built-in functions
- Units (SI and imperial)
- Special methods
-
Hover Documentation - Hover over functions to see descriptions
-
Run Files - Run Calcpad files directly from VS Code (Ctrl+Shift+B)
-
Color Theme - Includes a Monokai-based color theme optimized for Calcpad
Installation
From VS Code marketplace (Recommended)
From VSIX file
- Download the .vsix file
- In VS Code, press
Ctrl+Shift+Pand type "Install from VSIX" - Select the downloaded
.vsixfile
Usage
- Open any
.cpdfile - syntax highlighting is automatic - Start typing to see auto-completions
- Hover over functions for documentation
- Press
Ctrl+Shift+Bor right-click and select "Run Calcpad File" to execute
Color Theme
To use the included Calcpad Monokai theme:
- Press
Ctrl+K Ctrl+Tto open the theme picker - Select "Calcpad Monokai"
File Association
The extension automatically associates with .cpd files. To manually set the language:
- Click on the language indicator in the status bar (bottom right)
- Select "Calcpad"
Requirements
- VS Code 1.74.0 or higher
- Calcpad must be installed (https://calcpad.eu/download/calcpad-VM-setup-en-x64.zip)
Known issues
- $Map do not display plots in preview when PlotSVG mode is set to nonzero.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
MIT