Installation and Configuration

This guide describes the complete setup of WvdS FPC RAD Studio for VS Code.

Prerequisites

Visual Studio Code

Install VS Code from code.visualstudio.com. Minimum version: 1.85.0.

Check your installed version:

code --version

Free Pascal Compiler (FPC)

Option A: Lazarus Bundle (recommended)

The Lazarus IDE includes FPC. Download: lazarus-ide.org

Typical installation paths:

  • Windows: %LAZARUS%\fpc\3.2.2\bin\i386-win32\fpc.exe
  • Linux: /usr/lib/fpc/3.2.2/fpc
  • macOS: /usr/local/lib/fpc/3.2.2/fpc

Option B: Standalone FPC

Download: freepascal.org

Verification:

fpc -iV

Expected output: 3.2.2 or higher.

pas2js (for Web Projects)

pas2js is the Pascal-to-JavaScript transpiler for browser and Node.js applications.

Installation via Lazarus:

Search for „pas2js“ in the Lazarus Online Package Manager and install it.

Manual Installation:

Download: wiki.freepascal.org/pas2js

Verification:

pas2js -h

Optional Tools

Tool Usage Download
lazbuild Compile Lazarus projects (.lpi) without IDE Included in Lazarus
Inno Setup Create Windows installers jrsoftware.org
GNU make Execute Makefiles Included in MinGW/MSYS2

Extension Installation

Method 1: VS Code Marketplace

  1. Open VS Code
  2. Click on the Extensions icon (Ctrl+Shift+X)
  3. Search for „WvdS FPC“
  4. Install the desired extensions:
    • WvdS VSCode Core - Required
    • WvdS VSCode Build - Recommended
    • WvdS VSCode Projects - Recommended
    • WvdS VSCode UI Designer - For PXAML development
    • WvdS VSCode UI Meta - For IntelliSense
    • WvdS VSCode UI Preview - For live preview
    • WvdS VSCode Packaging - For VSIX creation

Method 2: Command Line

# Basic installation
code --install-extension wvds.wvds-vscode-core
code --install-extension wvds.wvds-vscode-build
code --install-extension wvds.wvds-vscode-projects
 
# UI development
code --install-extension wvds.wvds-vscode-ui-designer
code --install-extension wvds.wvds-vscode-ui-meta
code --install-extension wvds.wvds-vscode-ui-preview
 
# Packaging
code --install-extension wvds.wvds-vscode-packaging

Method 3: VSIX File

For offline installation or internal distribution:

  1. Download the .vsix files
  2. In VS Code: ExtensionsInstall from VSIX…
  3. Select the .vsix file

Toolchain Configuration

After installing the Core extension, the compiler paths must be configured.

Automatic Detection

The suite attempts to automatically find installed tools:

  1. Open the Command Palette: Ctrl+Shift+P
  2. Run: WvdS: Toolchain Configuration…
  3. The dialog shows detected tools with green checkmarks
  4. Tools not found are marked in red

Manual Configuration

If automatic detection fails, paths can be set manually:

Via Settings UI:

FilePreferencesSettings → Search for „wvds.toolchain“

Via settings.json:

Use environment variables instead of absolute paths for better portability.
{
  "wvds.toolchain.fpcPath": "${env:LAZARUS}/fpc/3.2.2/bin/i386-win32/fpc.exe",
  "wvds.toolchain.pas2jsPath": "${env:LAZARUS}/fpc/3.2.2/bin/i386-win32/pas2js.exe",
  "wvds.toolchain.lazbuildPath": "${env:LAZARUS}/lazbuild.exe",
  "wvds.toolchain.innoSetupPath": "${env:PROGRAMFILES(X86)}/Inno Setup 6/ISCC.exe",
  "wvds.toolchain.makePath": "${env:MSYS2}/usr/bin/make.exe"
}

Settings in Detail

Setting Description Default
wvds.toolchain.fpcPath Path to fpc.exe / fpc Auto-detection
wvds.toolchain.pas2jsPath Path to pas2js.exe / pas2js Auto-detection
wvds.toolchain.lazbuildPath Path to lazbuild.exe / lazbuild Auto-detection
wvds.toolchain.innoSetupPath Path to ISCC.exe Auto-detection
wvds.toolchain.makePath Path to make.exe / make Auto-detection
wvds.toolchain.wslEnabled WSL for Linux cross-compilation false
wvds.toolchain.wslDistribution WSL distribution (e.g. Ubuntu-22.04) „“

WSL Support (Windows)

For cross-compilation on Windows, WSL can be enabled:

Prerequisites

  1. WSL 2 with a Linux distribution installed (Ubuntu recommended)
  2. FPC installed in the WSL environment

Activation

{
  "wvds.toolchain.wslEnabled": true,
  "wvds.toolchain.wslDistribution": "Ubuntu-22.04"
}

Usage

With WSL enabled, the Linux FPC is used for Linux targets, while the Windows FPC remains active for Windows targets.

Verification

Verify your installation:

  1. Open the Command Palette: Ctrl+Shift+P
  2. Run: WVDS: Show Version Info
  3. The Output Channel shows all detected tools and versions

Expected output (paths vary by installation):

WvdS FPC RAD Studio v0.1.0
--------------------------
FPC: 3.2.2 (%LAZARUS%\fpc\3.2.2\bin\i386-win32\fpc.exe)
pas2js: 2.2.0 (%LAZARUS%\fpc\3.2.2\bin\i386-win32\pas2js.exe)
lazbuild: 3.4 (%LAZARUS%\lazbuild.exe)
Inno Setup: 6.2.2 (%PROGRAMFILES(X86)%\Inno Setup 6\ISCC.exe)

Troubleshooting

"FPC not found"

Cause: FPC is not installed or the path is incorrect.

Solution:

  1. Install FPC or Lazarus
  2. Set wvds.toolchain.fpcPath manually
  3. Ensure the path points to the .exe/.bin, not the folder

"pas2js not found"

Cause: pas2js was not installed with Lazarus.

Solution:

  1. Install pas2js via the Lazarus Package Manager
  2. Or download pas2js manually
  3. Set wvds.toolchain.pas2jsPath

Extension Does Not Start

Cause: Dependencies not met.

Solution:

  1. Ensure wvds-vscode-core is installed
  2. Check VS Code version (minimum 1.85.0)
  3. Restart VS Code

Compilation Fails

Cause: Missing units or incorrect paths.

Solution:

  1. Check the FPC output in the Terminal
  2. Ensure all unit paths are correct
  3. Check project settings

Next Steps

Zuletzt geändert: on 2026/01/29 at 10:24 PM