Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Delphi 6 Live LinterNew to Visual Studio Code? Get it now.
Delphi 6 Live Linter

Delphi 6 Live Linter

Manuel Antonio Garcia Garcia

|
1 install
| (0) | Free
All-in-one Delphi 6 (.pas) toolset: real-time linter, Quick Fixes, IntelliSense, formatter, snippets, dcc32/fpc .dpr->.exe builder, and native Win32 debugger.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Delphi 6 Live Linter

Delphi 6 Live Linter Preview

An all-in-one Visual Studio Code extension for Delphi 6 Object Pascal (.pas, .dpr, .dpk, .inc) built for real-world enterprise codebases — including massive 10,000–20,000+ line legacy units.

It combines a fast, cross-platform real-time linter (30 rules D6001–D6030), categorized diagnostics (Errors / Warnings / Hints), incremental Git diff mode, IntelliSense, formatting, snippets, a dedicated Delphi 6 Sidebar, real .dpr -> .exe & .bpg compilation via dcc32.exe / fpc, and a native Win32 Delphi 6 Debugger (F5) with TD32 named local variable inspection.

.dfm, .xfm, .fmx, and binary resource files are strictly excluded from Pascal syntax validation to prevent false positives, while sibling .dfm files are cross-checked against .pas form classes for missing event handlers and components.


Table of Contents

  • Quick Start
  • Integrated UI & Sidebar
  • Real-Time Linter Rules (D6001–D6030)
  • Noise Control & Incremental Git Diff Mode
  • Navigation, IntelliSense & Formatting
  • Project Building, Libraries & .dfm Support
  • Native Delphi 6 Debugger (Windows, F5)
  • Keyboard Shortcuts
  • Commands
  • Extension Settings
  • Performance on Large Units
  • License

Quick Start

  1. Install the extension and open your Delphi 6 workspace in Visual Studio Code.
  2. Open any .pas file: syntax highlighting, real-time validation, Outline, Go to Definition, and Quick Fixes activate immediately with zero setup.
  3. Configure Library Roots (optional): run Delphi 6: Discover Library Search Paths Recursively or set delphi6Validator.libraryRootPaths. On Windows, Delphi 6's global Library Search Path (HKCU\Software\Borland\Delphi\6.0\Library) and project .cfg/.dof files (with $(DELPHI) expansion) are read automatically.
  4. Build & Run (F9) or Debug (F5): press F9 to compile your .dpr to a real .exe and launch it natively, or press F5 to debug with breakpoints, Call Stack, TD32 named local variables, and Delphi exception decoding.

Integrated UI & Sidebar

  • Delphi 6 Activity Bar Sidebar:
    • Project & Build: auto-discovers .dpr and .bpg files with 1-click Build, Rebuild All (-B), Build & Run (F9), Project Group build, and Library Path discovery.
    • Diagnostics & Mode: live color-coded Errors / Warnings / Hints counters, 1-click Git Diff scope toggle, and Severity Filter.
    • Quality & Team Tools: 1-click access to Pre-Release Validation Gate, Dependency & Indy Conflict Audit, .dfm <-> .pas Sync, Binary .dfm Preview, Stack Trace / .map Analyzer, Markdown Doc Generator, DUnit Test Generator, FastMM4 Setup Guide, Report Export, and Output Log.
  • Status Bar Control Center: click Delphi 6: XE YW ZH in the status bar to open an instant QuickPick menu for Problems, Diff Mode, Severity Filter, Build & Run, Audit, and Export.
  • Editor Title Toolbar & Right-Click Menu: quick Build & Run, Switch Interface / Implementation, and Toggle Diff Mode buttons in the editor title bar, plus a grouped Delphi 6 context submenu and a 3-step Getting Started Walkthrough.

Real-Time Linter Rules (D6001–D6030)

Code Severity Description Quick Fix
D6001 Error Unterminated string literals ('...') or block comments ({...}, (*...*)) —
D6002 Error Missing or invalid unit structure (unit/program/library, interface, implementation, end.) —
D6003 Error Unbalanced blocks and delimiters (begin..end, repeat..until, try, case, record, class, (), []) —
D6004 Error try block without except or finally, or orphan except/finally —
D6005 Error Missing semicolon (;) after unit header, uses clause, var declarations, or statements inside begin..end Yes
D6006 Error Illegal semicolon (;) before else in if..then..else (permitted in case..of) Yes
D6007 Error Malformed uses clause (empty or trailing comma) —
D6008 Error Assignment vs. comparison mismatch (:= in if/while/until, or x = 5; as a standalone statement) Yes
D6009 Error Inline var declarations inside begin..end (unsupported in Delphi 6) —
D6010 Warning Unit name does not match the .pas filename Yes
D6011 Warning Duplicate unit name in the same uses clause —
D6012 Warning Unused local variable declared in a routine var section —
D6013 Warning Empty except block that silently swallows exceptions —
D6014 Warning function body that does not assign Result (or the function name) —
D6015 Error Missing then after if, do after while/for, or to/downto in for loops —
D6016 Error Duplicate local variable declaration in the same var block —
D6017 Warning Routine declared in interface with no matching implementation in implementation Yes
D6018 Error Post-Delphi 6 syntax incompatible with Delphi 6 (for..in, strict private/protected, class/record helper) —
D6019 Warning Unreachable statement after unconditional Exit;, Break;, Continue;, or raise —
D6020 Error Unclosed {$IFDEF}/{$IFNDEF} or orphan {$ELSE}/{$ENDIF} directives —
D6021 Error Signature mismatch between interface and implementation (parameters, return type, or procedure/function) —
D6022 Warning Assignment to an undeclared identifier in standalone routines (offline check) —
D6023 Warning Possible memory leak: unowned local object created with TClass.Create never freed or freed outside try..finally —
D6024 Hint Redundant boolean comparison (= True / = False) in condition Yes
D6025 Hint with statement usage suggestion (can hide scope ambiguities) —
D6026 Hint Overly long routine (>150 lines) refactoring suggestion —
D6027 Hint Suggests FreeAndNil(Obj) instead of Obj.Free inside finally blocks Yes
D6028 Warning Possible use-after-free / dangling pointer: local object accessed after .Free or FreeAndNil —
D6029 Error Event handler referenced in sibling .dfm (OnClick = ...) is missing from the .pas form class —
D6030 Warning Component declared in sibling .dfm is not declared in the .pas form class —

Noise Control & Incremental Git Diff Mode

  • 3-Category Severity Separation: Distinct red underlines (Errors), amber underlines (Warnings), and dotted blue underlines (Hints/Improvements), separate status bar counters (XE YW ZH), and quick severity filtering (All, Errors + Warnings, Errors Only).
  • Changed Lines Only (Git Diff Mode): Set delphi6Validator.analysisScope to "changedOnly" (or click the Toggle Diff Mode button) to show warnings and hints only on newly added/modified lines compared against HEAD while keeping critical syntax errors visible.
  • Granular Silencing:
    • Per-line: // delphi6-lint-disable-next-line D6012 or // delphi6-lint-disable-line D6006
    • Per-file: // delphi6-lint-disable-file or // delphi6-lint-disable-file D6012, D6023 (also supports { ... } comments)
    • Project/folder settings: disabledRules, ruleOverrides, and excludePatterns.

Navigation, IntelliSense & Formatting

  • Syntax Highlighting: Built-in Delphi 6 Object Pascal TextMate grammar (syntaxes/delphi6.tmLanguage.json) with auto-closing pairs and {$REGION} / {$ENDREGION} folding.
  • Autocomplete & Signature Help: Context-aware completions for local variables, parameters, unit declarations, Self. / Obj. class members, Delphi 6 BCL types (TStringList, TMemoryStream, TForm, TQuery, TIniFile, etc.), and live parameter hints while typing Call(.
  • Hover Information: Shows variable types, routine signatures, preceding doc comments, and Delphi 6 RTL built-in descriptions.
  • Go to Definition (F12), Switch interface / implementation (Ctrl+Shift+Up/Down), Find All References (Shift+F12), and Safe Rename (F2): Token-aware across the file and workspace uses units without touching strings or comments.
  • Format Document & Format Selection: Automatic block indentation and configurable keyword casing (lower, upper, or preserve), preserving strings, comments, directives, and asm..end blocks.
  • Code Snippets: unit, tryf, trye, class, proc, func, fori, foridown, tlist, case, ifdef, and region.

Project Building, Libraries & .dfm Support

  • Build & Run (.dpr -> .exe, F9) & Project Groups (.bpg): Compiles .dpr projects or multi-target .bpg groups in order using dcc32.exe (or fpc), writes real .exe and .dcu outputs to OutputDir / UnitOutputDir, and launches the .exe natively in Windows.
  • Smart Library Discovery:
    • Reads project .cfg and .dof files (expanding $(DELPHI) automatically from dcc32.exe).
    • Reads Delphi 6's global Library Search Path from the Windows Registry (HKCU\Software\Borland\Delphi\6.0\Library).
    • Recursively scans delphi6Validator.libraryRootPaths for .pas/.dcu/.inc folders and offers one-click "Add Missing Paths & Rebuild" when a unit is missing.
  • Binary .dfm Support (convert.exe): Automatically converts binary .dfm files via Delphi 6's convert.exe for .dfm <-> .pas cross-checking (D6029/D6030) and provides Preview Binary .dfm as Text.
  • Quality & Team Tools: Dependency & Indy conflict audit, Pre-Release Validation Gate, .map / EurekaLog / MadExcept / JclDebug stack trace analyzer, Markdown API doc generator, DUnit & FastMM4 scaffolds, and JSON/CSV/TXT report export.

Native Delphi 6 Debugger (Windows, F5)

Debug 32-bit Delphi 6 .exe binaries directly inside Visual Studio Code via the built-in Debug Adapter (type: "delphi6"):

  • Zero External Dependencies: Compiles a lightweight native 32-bit Win32 Debug API host automatically on Windows using the built-in .NET Framework 4.0 x86 csc.exe.
  • Auto-Build with TD32 + .map Symbols: Compiles your .dpr with -V -$D+ -$L+ -GD and reads PE32 ImageBase / .text RVA directly from the .exe.
  • Named Local Variables (TD32 FB09/FB0A): Parses Borland TD32 debug tables from the .exe or .tds file to display real local variable & parameter names in the Locals scope and evaluate them by name in Watch, Debug Console, and Editor Hover.
  • Breakpoints, Stepping & Exceptions: INT 3 (0xCC) breakpoints snapped to executable lines, Continue (F5), Step Over (F10) across branches, Step Into (F11), Step Out (Shift+F11), EBP Call Stack mapped to .pas lines, OutputDebugString capture, and Delphi 6 exception decoding (0x0EEDFADE VMT class name + Exception.Message, plus 0xC0000005 Access Violations).

Example .vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "delphi6",
      "request": "launch",
      "name": "Debug Delphi 6 App",
      "program": "${workspaceFolder}/MyProject.dpr",
      "buildBeforeLaunch": true,
      "breakOnDelphiExceptions": true
    }
  ]
}

Keyboard Shortcuts

Shortcut (Windows / Linux) macOS Action
F9 F9 Build & Run Project (.dpr -> .exe)
F5 F5 Launch & Debug Delphi 6 Project
Ctrl+Shift+Up / Down Cmd+Shift+Up / Down Switch Between interface and implementation
F12 F12 Go to Definition
Shift+F12 Shift+F12 Find All References
F2 F2 Safe Rename Symbol
Ctrl+Shift+O Cmd+Shift+O Go to Symbol / Outline

Commands

  • Delphi 6: Open Control Center
  • Delphi 6: Build Project (.dpr -> .exe)
  • Delphi 6: Rebuild All (.dpr -> .exe, -B)
  • Delphi 6: Build & Run Project (.exe)
  • Delphi 6: Build Project Group (.bpg)
  • Delphi 6: Validate Current .pas File
  • Delphi 6: Validate All .pas Files in Workspace
  • Delphi 6: Run Compiler Check (dcc32 / fpc)
  • Delphi 6: Switch Between Interface and Implementation
  • Delphi 6: Toggle Analysis Scope (Changed Lines Only / Full File)
  • Delphi 6: Filter Diagnostics by Severity
  • Delphi 6: Discover Library Search Paths Recursively
  • Delphi 6: Audit Project Dependencies & Conflicts (.pas/.dcu/Indy)
  • Delphi 6: Run Pre-Release Validation Gate
  • Delphi 6: Validate .dfm <-> .pas Components & Events
  • Delphi 6: Preview Binary .dfm as Text (convert.exe)
  • Delphi 6: Analyze Stack Trace / .map Crash Address
  • Delphi 6: Export Diagnostics Report (JSON / CSV / TXT)
  • Delphi 6: Generate Markdown Documentation for Current .pas
  • Delphi 6: Generate DUnit Test Unit for Current .pas
  • Delphi 6: Generate FastMM4 Memory Leak Setup Guide
  • Delphi 6: Clear Diagnostics
  • Delphi 6: Show Output Log

Extension Settings

{
  "delphi6Validator.enableRealtimeLint": true,
  "delphi6Validator.debounceMs": 250,
  "delphi6Validator.maxDiagnostics": 500,
  "delphi6Validator.analysisScope": "all",
  "delphi6Validator.alwaysShowErrorsInDiffMode": true,
  "delphi6Validator.severityFilter": "all",
  "delphi6Validator.disabledRules": [],
  "delphi6Validator.excludePatterns": ["**/*.dfm", "**/*.xfm", "**/*.fmx", "**/__history/**", "**/__recovery/**"],
  "delphi6Validator.ruleOverrides": [],
  "delphi6Validator.defines": ["WIN32", "MSWINDOWS", "VER140"],
  "delphi6Validator.enableCompilerOnSave": true,
  "delphi6Validator.autoReadProjectConfig": true,
  "delphi6Validator.readWindowsRegistryLibraryPath": true,
  "delphi6Validator.enableDfmCrossCheck": true,
  "delphi6Validator.compilerType": "auto",
  "delphi6Validator.compilerPath": "",
  "delphi6Validator.projectDprPath": "",
  "delphi6Validator.exeOutputDir": "",
  "delphi6Validator.unitOutputDir": "",
  "delphi6Validator.searchPaths": [],
  "delphi6Validator.libraryRootPaths": [],
  "delphi6Validator.extraArgs": [],
  "delphi6Validator.compilerTimeoutMs": 15000,
  "delphi6Validator.format.indentSize": 2,
  "delphi6Validator.format.keywordCase": "lower"
}

Performance on Large Units

Engineered specifically for legacy 10,000–20,000+ line Delphi 6 forms and data modules:

  • Shared bounded LRU token cache across validation, Outline, Go to Definition, IntelliSense, Hover, and formatting.
  • Adaptive debouncing (5k+ lines and 15k+ lines), document-version deduplication, and maxDiagnostics flood protection.
  • Verified benchmarks: 20,000+ line units validate in ~35–65 ms; autocomplete, hover, references, and doc generation run in < 40 ms combined.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft