VS Code

The ALCops VS Code extension is the recommended way to use ALCops during development. It automatically downloads and manages the analyzer DLLs for you.

Install the Extension

  1. Open VS Code and go to the Extensions view (Ctrl+Shift+X).
  2. Search for ALCops.
  3. Click Install.

Alternatively, install from the command line:

code --install-extension Arthurvdv.alcops

Once installed, the extension activates automatically when you open an AL project. It downloads the analyzer DLLs to the AL Language extension’s bin/Analyzers folder on first use.

Selecting Code Cops

The ALCops status bar item at the bottom of VS Code lets you quickly enable or disable individual analyzers. Click on ALCops in the status bar to open the selection menu, then toggle the cops you want active for your project.

Click the ALCops status bar item to enable or disable individual analyzers.

After changing your selection, reload the VS Code window (Ctrl+Shift+PDeveloper: Reload Window) for the AL Language Server to pick up the updated analyzer configuration.

Extension Settings

SettingDefaultDescription
alcops.automaticUpdatestrueAutomatically check for analyzer updates.
alcops.updateNotificationnotify-onlyHow updates are handled: auto-install, notify-only, or manual.
alcops.versionChannelstableWhich release channel to track: stable, beta, or alpha.
alcops.checkUpdateInterval24Hours between update checks (1-720).

Manual Setup (without the extension)

If you prefer not to use the extension, you can manually configure the AL Language extension to load ALCops analyzers.

Add the analyzer DLL paths to the al.codeAnalyzers setting in your VS Code settings (settings.json):

"al.codeAnalyzers": [
    "${CodeCop}",
    "${UICop}",
    "${analyzerfolder}ALCops.ApplicationCop.dll",
    "${analyzerfolder}ALCops.DocumentationCop.dll",
    "${analyzerfolder}ALCops.FormattingCop.dll",
    "${analyzerfolder}ALCops.LinterCop.dll",
    "${analyzerfolder}ALCops.PlatformCop.dll",
    "${analyzerFolder}ALCops.Common.dll"
]

The ${analyzerfolder} token resolves to the bin/Analyzers folder inside the AL Language extension. Place the downloaded DLLs there.