dotnet

fsharp-diagnostics

"After modifying any F# file, use this to get quick parse errors and typecheck warnings+errors. Also finds symbol references and inferred type hints."

dotnet 4,293 859 Updated 3mo ago

Resources

2
GitHub

Install

npx skillscat add dotnet/fsharp/fsharp-diagnostics

Install via the SkillsCat registry.

SKILL.md

F# Diagnostics

Scope: src/Compiler/ files only (FSharp.Compiler.Service.fsproj, Release, net10.0).

Setup (run once per shell session)

GetErrors() { "$(git rev-parse --show-toplevel)/.github/skills/fsharp-diagnostics/scripts/get-fsharp-errors.sh" "$@"; }

Parse first, typecheck second

GetErrors --parse-only src/Compiler/Checking/CheckBasics.fs

If errors → fix syntax. Do NOT typecheck until parse is clean.

GetErrors src/Compiler/Checking/CheckBasics.fs

Find references for a single symbol (line 1-based, col 0-based)

Before renaming or to understand call sites:

GetErrors --find-refs src/Compiler/Checking/CheckBasics.fs 30 5

Type hints for a range selection (begin and end line numbers, 1-based)

To see inferred types as inline // (name: Type) comments:

GetErrors --type-hints src/Compiler/TypedTree/TypedTreeOps.fs 1028 1032

Other

GetErrors --check-project   # typecheck entire project
GetErrors --ping
GetErrors --shutdown

First call starts server (~70s cold start, set initial_wait=600). Auto-shuts down after 4h idle. ~3 GB RAM.