How to use the Umfeld extension for VS Code
The official Umfeld extension turns VS Code into a compact control panel for installing Umfeld, creating projects, compiling, running, and debugging sketches. It supports macOS, Linux, Raspberry Pi, and Windows through MSYS2 UCRT64.
The extension uses the official Umfeld installer and delegates C++ project management to Microsoft’s CMake Tools. This means projects created in VS Code remain ordinary CMake projects: you can still build them from a terminal or open them in another editor.
Before you start
Install Visual Studio Code. Setup on macOS and Linux
requires Bash and curl. On Windows, install MSYS2; Umfeld uses
the UCRT64 toolchain rather than Visual Studio’s MSVC toolchain.
The extension also installs or recommends these supporting extensions:
- CMake Tools for configuring, compiling, launching, and selecting targets and compilers
- C/C++ for code completion and graphical debugging
If you prefer to install Umfeld without an editor, follow the desktop setup guide instead. You can then point the extension at that existing installation.
1. Install the extension
Open the Extensions view in VS Code (Ctrl+Shift+X, or Cmd+Shift+X on macOS), search
for Umfeld, and install the extension published by umfeld. Its extension identifier
is umfeld.umfeld.
If you have downloaded a .vsix package instead, open the Extensions view’s … menu,
choose Install from VSIX…, and select the file.
After installation, select the Umfeld logo in the Activity Bar. The Umfeld panel contains four sections:
- Develop — Compile + Run, Debug, Compile, and Clean
- Project — create a blank sketch or copy an example
- Environment — check or install Umfeld
- Resources — open the documentation and example repository
All panel actions are also available from the Command Palette (Ctrl+Shift+P or
Cmd+Shift+P). Type Umfeld: to list them.
2. Set up Umfeld
If Umfeld is not installed yet, expand Environment and select Set Up Umfeld.
- Choose a version. The newest stable release is recommended;
mainis the current development version. You can also enter another release tag or branch. - Choose an install location. This is the parent directory in which the installer creates
umfeld,umfeld-examples, andumfeld-libraries. - Follow the prompts in the Umfeld Setup terminal. The extension runs Umfeld’s official installer, which handles the required platform packages and checks out matching versions of all three repositories.
- Wait for the installer to finish, then restart VS Code. Restarting ensures that CMake, the compiler, and other tools inherit the newly installed environment.
Choose a location that does not already contain any of the three repository folders. The setup command stops rather than overwriting an existing checkout.
Windows setup
Install MSYS2 before running Set Up Umfeld. By default, the extension looks in
C:\msys64, C:\msys2, and ~/msys64. It opens an MSYS2 Bash terminal configured for
UCRT64 and installs curl there if needed.
If MSYS2 is elsewhere, open VS Code Settings, search for Umfeld MSYS2, and set
Umfeld: Msys2 Path to the MSYS2 root—the folder containing ucrt64\bin.
Use an existing Umfeld installation
You do not need to reinstall Umfeld. The extension checks, in order:
- Umfeld: Path in VS Code Settings
- the
UMFELD_PATHenvironment variable - simple
UMFELD_PATHexports in common shell profile files on macOS and Linux - common install locations such as
~/umfeldand~/Documents/umfeld/umfeld
Open Settings and set Umfeld: Path to the umfeld library folder if automatic detection
fails. Set Umfeld: Examples Path to umfeld-examples if it is stored elsewhere. The
examples repository is only required for New Project and Copy Example as Project;
an existing project can compile without it.
You can also select Check Setup, then choose Select Existing Umfeld when the check reports a missing library.
3. Check the environment
Select Environment → Check Setup. A report opens in the Umfeld Setup output channel and checks:
- the CMake Tools extension
- the
cmakeexecutable - the Umfeld library checkout
- the optional
umfeld-examplescheckout - MSYS2 UCRT64 on Windows
OK means the item was found, MISSING requires attention, and OPTIONAL does not prevent
an existing project from building. If CMake is not on VS Code’s PATH, the report may show
a warning even when a selected CMake Tools kit can provide it.
4. Create a project
Select Project → New Project. The extension copies the canonical
umfeld-examples/Basics/template, so the new project always matches your installed Umfeld
version.
- Enter a project name. Use letters, numbers, hyphens, and underscores only.
- Select a parent folder. The extension creates a new folder with the project name.
- Choose how to open it:
- Add to Current Workspace keeps your current window and adds the project folder.
- Open in New Window opens a separate VS Code window.
- Open Project is shown when no workspace is already open.
- Open
application.cppand start sketching.
The copied folder is independent of umfeld-examples; editing it does not change the
original template. The extension also adds recommendations for Umfeld, CMake Tools, and
C/C++, and disables automatic CMake configuration on first open. Configuration starts when
you first compile.
If VS Code opens the folder in Restricted Mode, trust the folder and make sure the recommended extensions are enabled. Otherwise build and debug commands may not be available.
5. Compile and run
Select Develop → Compile + Run. On the first compile, CMake Tools may ask you to choose a compiler kit:
- Choose [Unspecified] to let CMake use the system default.
- Or select the GCC, Clang, AppleClang, or MSYS2 compiler that belongs to your toolchain.
- If the project provides CMake presets, use its preset instead; the extension does not override preset-based projects.
By default, the extension remembers your last explicitly selected kit and offers it in new Umfeld workspaces. Disable Umfeld: Remember Compiler in Settings if you prefer to choose each time.
CMake Tools may also ask you to select a launch target when a project defines more than one. Choose your sketch’s executable target.
Compile + Run performs an incremental compile and launches the selected target. After
editing application.cpp, select it again to rebuild only what changed. A message such as
ninja: no work to do is normal: it means the executable is already up to date.
The Develop actions
- Compile + Run compiles before launching. If CMake Tools’
cmake.buildBeforeRunsetting is disabled, the label changes to Run and launches the existing build without compiling first. - Compile performs an incremental build without launching the sketch.
- Debug starts the selected target through CMake Tools and the C/C++ debugger.
- Clean runs CMake Tools’ clean action for the active project. Compile again afterward to recreate the build output.
Compiler kits, CMake presets, build variants, targets, and toolchain files remain managed by CMake Tools. The Umfeld extension deliberately does not create a second set of build settings.
6. Debug a sketch
First select a Debug build variant in CMake Tools so the executable contains useful debug
symbols. Open application.cpp, click in the gutter beside a line to add a breakpoint, and
then select Develop → Debug.
When execution pauses, use VS Code’s Run and Debug view to inspect local variables, add
watches, move through the call stack, or step over and into functions. Breakpoints inside
draw() are reached every frame, so add a condition such as frameCount == 300 when you
only need to inspect one moment.
For crashes, hangs, watchpoints, and command-line debugging, see Everything you always wanted to know about GDB but were afraid to ask.
7. Start from an example
Select Project → Copy Example as Project to browse every CMake project in your installed
umfeld-examples checkout. Search by example name or category, select one, give the copy a
project name, and choose its destination.
The extension skips .git and existing build directories while copying, updates the CMake
project declaration, and leaves the original example untouched. You can therefore experiment
freely and keep the copied sketch as a standalone project.
Troubleshooting
The Umfeld panel cannot find my installation
Run Check Setup and select the existing library folder, or set Umfeld: Path manually.
The configured path must be the actual umfeld checkout containing CMakeLists.txt and
include/Umfeld.h or src/Umfeld.cpp. The folder picker also accepts its direct parent when
that parent contains a folder named umfeld.
New Project or Copy Example is unavailable
Those actions require umfeld-examples. Set Umfeld: Examples Path to that repository,
or run Set Up Umfeld to install version-matched repositories. The library alone is enough
to compile projects you already have.
CMake Tools asks for a compiler
This is expected on the first compile. CMake is the build system, not the compiler. Choose [Unspecified] for the system default, or select the compiler installed for your platform. On Windows, select an MSYS2 UCRT64 GCC kit—not MSVC or a MINGW64 kit.
Compile succeeds, but the wrong program launches
Use CMake Tools to change the active launch target, then run the Umfeld action again. The extension always respects CMake Tools’ current folder, target, preset, kit, and variant.
Compile + Run only says Run
The CMake Tools setting cmake.buildBeforeRun is disabled for the active folder. Enable it
to compile automatically before every launch, or use Compile and Run separately.
A newly opened project has no extension actions
Check Workspace Trust and extension enablement. Trust the project if appropriate, then confirm that Umfeld, CMake Tools, and C/C++ are enabled in that workspace.