This is the first release of the VS Code Aster extension. The main objective is to collect feedback on any bugs or anomalies you encounter during its usage. All input regarding features is valuable, whether it's about how commands are triggered, unexpected behaviors, or options that could be added. Your experience and suggestions greatly help improve the extension.
VS Code Aster is a Visual Studio Code extension designed to simplify and speed up work with code_aster. It offers:
- An interactive form to create or edit a
.exportfile - The ability to launch simulations directly from VS Code
- Advanced features for editing
.commfiles - A fully integrated 3D Visualizer to explore your meshs
The VS Code Aster extension is now available on the VS Code Marketplace :
- Open VS Code then go to the Extensions tab (or press
Ctrl + Shift + X/Cmd + Shift + X). - Search for
VS Code Aster. - Click on Install.
-
Download the .vsix file from the latest release :
- Choose your preferred version (latest is recommended)
- In the "Assets" section, click on the
vs-code-aster-[version].vsixbutton.
WSL users will need to copy the .vsix file to the WSL file system before continuing with the installation.
cp /mnt/c/Users/[UserName]/Downloads/vs-code-aster-[version].vsix ~/
- Once you've got the
.vsixfile ready, you can open VS Code and :- Open the Command Palette (
Ctrl + Shift + P/Cmd + Shift + P). - Search for and run
Extensions: Install from VSIX.... - Select the downloaded
.vsixfile. - Reload your VS Code window — your extension is now installed !
- Open the Command Palette (
This extension requires Python 3.8 or later and the following packages :
numpypygls==1.3.1medcoupling
Here are two ways to install these packages :
If you prefer to isolate your dependencies, or if pip cannot install system-wide packages, you can setup a virtual environment :
# Create a virtual environment
python3 -m venv ~/[env_name]
# Activate the venv
source ~/[env_name]/bin/activate
# Install required packages
pip install numpy pygls==1.3.1 medcouplingThen point the extension to this environment :
- Open
File > Preferences > Settings(or pressCtrl + ,/Cmd + ,). - In the search bar, type
VS Code Aster. - Locate
Python Executable Path. - Set it to the absolute path of your environment’s Python executable, for example :
/home/[username]/[env_name]/bin/python
- Reload the VS Code window (
Ctrl + R/Cmd + R).
If you'd rather install the Python packages globally :
pip install numpy pygls==1.3.1 medcouplingIf you'd like to run simulations, you need to have cave installed on your system. You can follow the instructions on the cave GitHub repository.
You're now ready to use VS Code Aster !
The extension provides an interface to create and manage .export files more easily, through a web form.
There are two ways to open the form :
- Option 1 - recommended when creating a new file :
- Open the Command Palette (
Ctrl + Shift + P/Cmd + Shift + P) - Search for
Edit export filethen click on it. - The form will be pre-filled with placeholder data that should be modified to your desires.
- Open the Command Palette (
- Option 2 - recommended when editing an existing file :
- Open an
.exportfile. - Click the book icon
Edit export filein the top-right corner of the file. - The form will be pre-filled with existing data, ready to be modified.
- Open an
- Any field highlighted in red will block the creation of the export file.
- Once the
Createbutton is clicked and the form is valid, a.exportfile will be created at the place it has been opened (replacing the previous file if it existed).
You need to have cave installed on your system to launch simulations. Refer to the cave GitHub repository if you want to install cave.
From a .export file
- Open a
.exportfile. - Click on the "play" icon
Run with code_asterin the top-right corner of the file.
It will open a terminal and execute the following command : cave run [file].export.
Personnalize alias to run code-aster
If you want to use a custom alias, you can :
- Open VS Code.
- Go to
File > Preferences > Settings(or pressCtrl + ,/Cmd + ,). - In the search bar, type
VS Code Aster. - Find the setting
Alias For Runand change the value to the command you want to use to run code_aster.
Syntax highlighting
- Dedicated highlighting for code_aster syntax, making
.commfiles more readable - For the best experience, use a theme that differentiates functions, variables, etc.
Hover documentation
- When hovering over a code_aster command, a tooltip displays :
- The command description
- The command arguments
- The types and default values of arguments
Command signatures
- When typing a
(after a command name, or a,after entering an argument (e.g.,FORMAT="MED",), a signature is displayed - This signature shows the parameters (depending on context — some parameters are only available under certain conditions)
Contextual auto-completion
- The extension automatically suggests :
- Command names
- Relevant arguments depending on the current command
Status Bar
- A status bar is displayed at the bottom of the window, showing the number of steps completed in the current command file, e.g.,
code_aster: 3/5 steps. - Clicking on the status bar opens a detailed view of completed commands for each family.
The visualizer is an integrated 3D viewer that lets you display and explore your simulation geometry and results directly in VS Code — without leaving your workspace.
It’s powered by VTK.js, and supports both mesh visualization and node-based groups.
The visualizer is very easy to open :
- Open a
.commfile. - Click on the "eye" icon
Open visualizerin the top-right corner of the file.
The visualizer is now open !
- Load geometry files (
.med) directly into the viewer - Highlight face and node groups using the sidebar
- Highlight groups quickly by selecting their names from your command file (
.comm) - Control the camera with by rotating or panning it
- Group highlighting :
- Click on a group name in the sidebar to highlight or unhighlight it
- Click on the "clear" button in the sidebar to reset highlight status for all groups
- Click on the "filter" button in the sidebar to choose which groups are easily accessible in the sidebar
- Objects becomes transparent when you highlight their groups, helping visualize details more clearly
- Camera control :
- Hold
Left clickand move your mouse to rotate the camera - Hold
Ctrl+Left clickand move your mouse to rotate the camera around an axis - Hold
Shift+Left clickand move your mouse to pan the camera - Use the
Mouse wheelto zoom in and out - Click on the
X,Y, andZbuttons at the bottom of the sidebar to quickly align the camera along an axis
- Hold
- File management :
- Mesh files (
.*medfiles) are converted to.objfiles, which are stored in a hidden folder called.visu_data/in your workspace
- Mesh files (
If you encounter an error that seems to have broken the language server (for .comm files), you can restart it without closing VS Code:
- Open the Command Palette (
Ctrl + Shift + P/Cmd + Shift + P). - Type
Restart the LSP Server for code_asterand select it. - The language server will restart, restoring hover, signature help, completion, and other language features !
You need to follow the installation steps before proceeding with this section.
You need to have Node.js 20 or later and npm installed on your system :
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Check installation
node -v
npm -v- Clone the repository :
git clone https://github.com/simvia-tech/vs-code-aster.git- Install packages :
npm install- Compile extension :
npm run compileYou can press F5 or go to Run > Start Debugging to launch a new VS Code window running this extension.
After making changes, you can reload the new window using Ctrl + R.
VS Code Aster includes optional telemetry features to help improve the tool by collecting anonymous usage data.
By default, usage tracking is enabled, sending anonymous data about which features you use. You can disable this tracking if you prefer.
To deactivate telemetry :
- Open VS Code Settings (
File > Preferences > SettingsorCtrl + ,/Cmd + ,) - Search for
VS Code Asterin the settings search bar - Find the setting
Enable Telemetryand uncheck it
Telemetry respects your privacy and does not collect sensitive information.
Please check out our CONTRIBUTING.md file if you want to contribute to the project.
Thank you to all our contributors :
This project is licensed under the GNU General Public License version 3 (GPL-3.0). See the full license text in the LICENSE file.
- Summary: You are free to use, copy, modify, and redistribute this software.
- Conditions: Redistributions and derivative works must be licensed under GPL-3.0 and include source or a written offer to provide the source.
- More information: https://www.gnu.org/licenses/gpl-3.0.en.html
Contact us at ulysse.bouchet@simvia.tech or basile.marchand@simvia.tech.
