Inhaltsverzeichnis
Installation und Konfiguration
Anleitung zur Einrichtung der WvdS FPC Tools in Visual Studio Code.
Extension installieren
Variante 1: Extension Pack (empfohlen)
- VSCode öffnen
- Extensions Sidebar (
Ctrl+Shift+X) - Suche:
WvdS FPC Tools - Install klicken — installiert alle drei Extensions automatisch
Variante 2: Einzelne Extensions
Falls nur bestimmte Extensions benötigt werden:
| Extension | Package-ID |
| Solution Manager | wvds.wvds-fpc-solution-manager |
|---|---|
| PAS2JS Studio | wvds.wvds-fpc-pas2js-studio |
| ISS Designer | wvds.wvds-fpc-iss-designer |
Variante 3: VSIX-Datei
code --install-extension wvds-fpc-solution-manager-0.1.0.vsix code --install-extension wvds-fpc-pas2js-studio-0.1.0.vsix code --install-extension wvds-fpc-iss-designer-0.1.0.vsix
Toolchain einrichten
Free Pascal Compiler (FPC)
Download: https://www.freepascal.org/download.html oder via fpcupdeluxe
Empfohlene Installation:
| Variante | Pfad |
| Lazarus-Bundle | C:\Lazarus (enthält FPC + Lazarus + pas2js) |
|---|---|
| fpcupdeluxe | Benutzerdefiniert |
Konfiguration in VSCode:
fpc-solution-manager.fpcPath— Pfad zum FPC Compilerfpc-solution-manager.lazbuildPath— Pfad zu lazbuildfpc-solution-manager.lazarusPath— Lazarus-Installationsverzeichnis
Oder: Setup Toolchain Wizard über die Command Palette (Ctrl+Shift+P → Setup Toolchain).
Die Extension erkennt automatisch FPC-Installationen in Standardpfaden.
pas2js
pas2js ist im Lazarus-Bundle enthalten (ab 3.0). Separater Download:
https://wiki.freepascal.org/pas2js
Konfiguration:
fpc-pas2js.pas2jsPath— Pfad zupas2js.exefpc-pas2js.pas2jsRtlPath— Pfad zu pas2js RTL Packages
InnoSetup
Download: https://jrsoftware.org/isinfo.php
Konfiguration:
fpc-iss.innoSetupPath— Pfad zuiscc.exe(z.B.C:\Program Files (x86)\Inno Setup 6\iscc.exe)
Pascal Language Server (pasls)
Optional aber empfohlen für Code Completion, Go to Definition und Navigation.
Quellcode: https://github.com/castle-engine/pascal-language-server
Mindestanforderungen: FPC >= 3.2.0 + Lazarus (für lazbuild)
Variante A: Selbst kompilieren (empfohlen)
# 1. Repository klonen cd D:\Workspace\3rd git clone https://github.com/castle-engine/pascal-language-server.git cd pascal-language-server git submodule update --init --recursive # 2. Mit lazbuild kompilieren cd server C:\Lazarus\lazbuild.exe pasls.lpi # 3. Binary installieren copy pasls.exe C:\Lazarus\pasls.exe
Variante B: Castle Game Engine
pasls wird mit Castle Game Engine ausgeliefert (bin/pasls.exe). Nachteil: ~500 MB Download für ein 5-MB-Binary.
Konfiguration
fpc-solution-manager.pasls.enabled—true(Standard)fpc-solution-manager.paslsPath— Pfad zupasls.exe(Auto-Detection sucht inC:\Lazarus, Lazarus-Verzeichnis, FPC-bin-Verzeichnis und PATH)fpc-solution-manager.fpcSourcePath— Pfad zu FPC-Quellen (z.B.C:\Lazarus\fpc\3.3.1\source) — wird alsFPCDIRan pasls übergeben
Unterstützte LSP-Features
| Feature | Tastenkürzel | Status |
| Code Completion | Ctrl+Space | Verfügbar |
|---|---|---|
| Signature Help | automatisch bei ( | Verfügbar |
| Go to Definition | F12 | Verfügbar |
| Go to Declaration | Ctrl+Click | Verfügbar |
| Go to Implementation | Ctrl+Shift+F12 | Verfügbar (via Definition-Fallback) |
| Document Symbols (Outline) | Ctrl+Shift+O | Verfügbar (Methoden/Prozeduren) |
| Workspace Symbols | Ctrl+T | Verfügbar |
| Hover mit Typ-Info + PasDoc | Mauszeiger | Verfügbar (pasls-nativ + Fallback) |
| Find All References | Shift+F12 | Verfügbar |
| Document Highlight | automatisch | Verfügbar |
| Rename Symbol | F2 | Geplant (erfordert pasls-Update) |
| Diagnostics (Fehler/Warnungen) | — | Geplant (erfordert pasls-Update) |
Debugging/Logging
pasls kann über eine castle-pasls.ini Datei konfiguriert werden (Log-Pfad, Verbosity). Platziere die Datei neben pasls.exe.
Erstes Projekt
Bestehendes Lazarus-Projekt öffnen
- Ordner mit
.lpioder.lpgDatei in VSCode öffnen - Solution Manager erscheint automatisch in der Activity Bar (links)
- Projekt-Baum zeigt Units, Formulare, Packages, Dependencies
Neues Projekt erstellen
- Bei leerem Workspace öffnet sich der Unified Project Wizard automatisch
- Alternativ: Command Palette
Ctrl+Shift+P→FPC: New Project… - Intent wählen (FPC nativ, pas2js Web, bestehendes öffnen)
- Projekttyp, Name und Speicherort konfigurieren
- Projekt wird erstellt und im Tree View angezeigt
autoShowStartWizard deaktivieren.
pas2js Extension-Projekt
- Ordner mit
package.json(VSCode Extension Manifest) öffnen - Solution Manager erkennt das Projekt automatisch als virtuelles pas2js-Projekt
- Build:
Ctrl+Shift+Boder Tree View → Build
Tastenkürzel
| Kürzel | Aktion |
Ctrl+Shift+B | Build Project |
|---|---|
F5 | Run Project |
F9 | Build and Run |
Shift+F9 | Rebuild Project |
Ctrl+Shift+C | Clean Project |
F4 | Properties |
F12 | Toggle Form/Code |
Ctrl+Shift+A | Add Unit |
Ctrl+Shift+M | Select Build Mode |
Ctrl+Shift+R | Refresh Tree |
Shift+F5 / Ctrl+F2 | Stop Process |
Alt+Shift+R | Reveal in Explorer |
Verifizierung
Nach der Installation prüfen:
- Activity Bar: FPC Solution Manager Icon sichtbar?
- Tree View: Projekte werden erkannt und angezeigt?
- Build:
Ctrl+Shift+Bkompiliert erfolgreich? - Output:
FPC Solution ManagerKanal zeigt Log-Meldungen?
Fehlerbehebung
Extension wird nicht aktiviert
- Prüfen ob
package.json,.lpioder.lpgim Workspace vorhanden ist - Output Panel →
FPC Solution ManagerKanal prüfen - VSCode neu laden:
Developer: Reload Window
Compiler nicht gefunden
- Pfade in den Settings prüfen (
fpc-solution-manager.fpcPath) Setup ToolchainWizard ausführen- Lazarus-Installation verifizieren:
fpc -vin Terminal ausführen
pasls funktioniert nicht
fpc-solution-manager.pasls.enabledauftruesetzen- Pfad zu
pasls.exeinfpc-solution-manager.paslsPathsetzen fpc-solution-manager.fpcSourcePathauf FPC-Quellen zeigen lassen (z.B.C:\Lazarus\fpc\3.3.1\source)fpc-solution-manager.lazarusSourcePathmuss auf Lazarus-Quellen zeigen- Output Panel → FPC Solution Manager Kanal prüfen — Log-Zeile
pasls initialized successfully.bestätigt den Start - Manueller Test:
echo '{„jsonrpc“:„2.0“,„id“:1,„method“:„initialize“,…}' | pasls.exe— muss JSON-Response liefern