VS Code

In Editor Configuration: Supported

Code Action On Save: Supported

Using ZLS in VS Code is as simple as installing the official Zig Language extension.

Configuration

The VS Code extension can automatically install Zig and ZLS. The extension is intended to provide the best possible experience Out-of-the-Box without extra configuration.

With that being said, there are some Zig specific settings that you may wish to apply:

  // All nested settings will only affect Zig files.
  "[zig]": {
    // Formatting with ZLS matches `zig fmt`.
    // The Zig FAQ answers some questions about `zig fmt`:
    // https://github.com/ziglang/zig/wiki/FAQ
    //
    // disable format-on-save
    // "editor.formatOnSave": false,

    // disable inlay hints
    // "editor.inlayHints.enabled": "off",

    // overwrite words when accepting completions
    "editor.suggest.insertMode": "replace",
    // The `foldingProviderModel` provides more accurate stick scroll scopes
    "editor.stickyScroll.defaultModel": "foldingProviderModel",
    "editor.codeActionsOnSave": {
      // Run code actions that currently supports adding and removing discards.
      // "source.fixAll": "explicit",
      
      // Run code actions that sorts @import declarations.
      // Available since ZLS `0.14.0-dev.188+2be424de5`
      // "source.organizeImports": "explicit",
    }
  },

Add it to your settings.json (open with Preferences: Open User Settings (JSON))