Anleitung zur Einrichtung der WvdS FPC Tools in Visual Studio Code.
Ctrl+Shift+X)WvdS FPC ToolsFalls 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 |
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
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 ist im Lazarus-Bundle enthalten (ab 3.0). Separater Download:
https://wiki.freepascal.org/pas2js
Konfiguration:
fpc-pas2js.pas2jsPath — Pfad zu pas2js.exefpc-pas2js.pas2jsRtlPath — Pfad zu pas2js RTL PackagesDownload: https://jrsoftware.org/isinfo.php
Konfiguration:
fpc-iss.innoSetupPath — Pfad zu iscc.exe (z.B. C:\Program Files (x86)\Inno Setup 6\iscc.exe)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)
# 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
pasls wird mit Castle Game Engine ausgeliefert (bin/pasls.exe). Nachteil: ~500 MB Download für ein 5-MB-Binary.
fpc-solution-manager.pasls.enabled — true (Standard)fpc-solution-manager.paslsPath — Pfad zu pasls.exe (Auto-Detection sucht in C:\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 als FPCDIR an pasls übergeben| 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) |
pasls kann über eine castle-pasls.ini Datei konfiguriert werden (Log-Pfad, Verbosity). Platziere die Datei neben pasls.exe.
.lpi oder .lpg Datei in VSCode öffnenCtrl+Shift+P → FPC: New Project…autoShowStartWizard deaktivieren.
package.json (VSCode Extension Manifest) öffnenCtrl+Shift+B oder Tree View → Build| 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 |
Nach der Installation prüfen:
Ctrl+Shift+B kompiliert erfolgreich?FPC Solution Manager Kanal zeigt Log-Meldungen?package.json, .lpi oder .lpg im Workspace vorhanden istFPC Solution Manager Kanal prüfenDeveloper: Reload Windowfpc-solution-manager.fpcPath)Setup Toolchain Wizard ausführenfpc -v in Terminal ausführenfpc-solution-manager.pasls.enabled auf true setzenpasls.exe in fpc-solution-manager.paslsPath setzenfpc-solution-manager.fpcSourcePath auf FPC-Quellen zeigen lassen (z.B. C:\Lazarus\fpc\3.3.1\source)fpc-solution-manager.lazarusSourcePath muss auf Lazarus-Quellen zeigenpasls initialized successfully. bestätigt den Startecho '{„jsonrpc“:„2.0“,„id“:1,„method“:„initialize“,…}' | pasls.exe — muss JSON-Response liefern