FsHotWatch.Analyzers 0.3.0-alpha.1

This is a prerelease version of FsHotWatch.Analyzers.
dotnet add package FsHotWatch.Analyzers --version 0.3.0-alpha.1
                    
NuGet\Install-Package FsHotWatch.Analyzers -Version 0.3.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsHotWatch.Analyzers" Version="0.3.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHotWatch.Analyzers" Version="0.3.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="FsHotWatch.Analyzers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsHotWatch.Analyzers --version 0.3.0-alpha.1
                    
#r "nuget: FsHotWatch.Analyzers, 0.3.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FsHotWatch.Analyzers@0.3.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FsHotWatch.Analyzers&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FsHotWatch.Analyzers&version=0.3.0-alpha.1&prerelease
                    
Install as a Cake Tool

FsHotWatch.Analyzers

Plugin that runs F# analyzers in-process using the warm FSharpChecker's check results. Compatible with G-Research F# Analyzers SDK and custom [<CliAnalyzer>] implementations.

Why

F# analyzers normally need to start their own compiler to get type information. With FsHotWatch, the compiler is already warm -- analyzers get parse results and check results instantly, so they run in milliseconds instead of minutes.

How it works

  1. You save a file
  2. The daemon type-checks it with the warm FSharpChecker
  3. AnalyzersPlugin receives FileChecked with the results
  4. It constructs a CliContext from the warm results (via reflection to handle FCS version mismatches)
  5. It runs all loaded analyzers against that context
  6. Diagnostics are reported to the error ledger

Configuration

In .fs-hot-watch.json:

{
  "analyzers": {
    "paths": ["analyzers/"]
  }
}
Field Type Default Description
paths string[] -- Directories containing analyzer DLLs. Relative paths are resolved from the repo root.

Writing a custom analyzer

See the ExampleAnalyzer for a complete working example. Here's the key pattern:

open FSharp.Analyzers.SDK

[<CliAnalyzer("MyAnalyzer", "Description of what it checks")>]
let myAnalyzer: Analyzer<CliContext> =
    fun (context: CliContext) ->
        async {
            // context.ParseFileResults has the AST
            // context.CheckFileResults has type info
            // Walk the AST, find issues, return diagnostics
            return
                [ { Type = "My Rule"
                    Message = "Something is wrong here"
                    Code = "MY-001"
                    Severity = Severity.Warning
                    Range = someRange
                    Fixes = [] } ]
        }

Build the analyzer as a class library and point analyzers.paths at the output directory.

CLI

# Query analyzer diagnostics
fs-hot-watch diagnostics

Programmatic usage

daemon.RegisterHandler(
    AnalyzersPlugin.create
        [ "/path/to/analyzers" ]   // directories with analyzer DLLs
        None                        // getCommitId for caching
)

Install

dotnet add package FsHotWatch.Analyzers
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-alpha.1 35 4/8/2026
0.1.0-alpha.1 44 4/3/2026