← fspure

Get started

You already write F#. You want pure / impure labels on your functions in the editor — nothing else.

You need two small pieces plus Ionide (the usual F# language support for VS Code):

  1. Analyzer — decides pure vs impure
  2. Extension — draws the badges at end of line

1. Add the analyzer to your project

Command line
dotnet add package FSharp.PureAnalyzer --version 0.4.0

Or with Paket:

Paket
nuget FSharp.PureAnalyzer 0.4.0

Copy the package’s analyzers/dotnet/fs/ folder into a workspace folder named analyzers (next to your solution). Ionide needs a real path — not ~ and not VS Code variables.

2. Install the editor pieces

  • Ionide for F# — if you don’t already use it
  • F# Pure Analyzer Decorations (e-st.fsharp-pure-decorations) from Open VSX (or the .vsix from GitHub Releases)

3. Turn on analyzers in the workspace

Create or edit .vscode/settings.json:

Workspace settings
{
  "FSharp.enableAnalyzers": true,
  "FSharp.analyzersPath": [
    "analyzers",
    "packages/Analyzers"
  ],
  "fsharpPureDecorations.enabled": true,
  "FSharp.lineLens.enabled": "replaceCodeLens",
  "FSharp.lineLens.prefix": "  // ",
  "workbench.colorCustomizations": {
    "editorHint.foreground": "#00000000",
    "editorHint.border": "#00000000",
    "editorOverviewRuler.hintForeground": "#00000000"
  }
}

4. Open a file and wait a moment

Open your solution, open any .fs file, wait for Ionide to load. Definitions should show end-of-line badges:

  • pure — only pure callees (safe subset)
  • impure — touches I/O, mutation, randomness, or other impurity

That is the default experience. You do not need the collector, ready-lib, or monorepo tooling for everyday app code.

If nothing shows up

  • Is Ionide running? (F# language features work?)
  • Is FSharp.enableAnalyzers true?
  • Does analyzers/ (or your FSharp.analyzersPath) exist and contain the DLL?
  • Reload the window after installing the extension

Optional: empty project that already has fspure

Prefer a ready-made Codespace / dev container instead of wiring a package yourself? Try e-St/fstarter — open it and write F#.

GitHub · Releases · Home

Home Legal Privacy