AstAnalyzer Module
Types
| Type | Description |
|
The combined output of analyzing a source file: symbols, dependencies, and test methods. Diagnostic counters for observability into the analysis pipeline. These track how many symbols/edges were dropped during analysis to help diagnose missing dependency edges. |
|
|
|
|
|
A directed dependency from one symbol to another, with its kind. |
|
|
The kind of edge in a dependency graph (calls, uses type, pattern match, etc.). |
|
|
Maps an HTTP route (method + URL pattern) to its handler's source file. |
|
|
A symbol's fully-qualified name, kind, source file, and line span. |
|
|
Discriminated union for kinds of F# symbols (function, type, DU case, etc.). |
|
|
Describes a test method's fully-qualified name, project, class, and method name. |
Functions and values
| Function or value |
Description
|
Full Usage:
analyzeSource checker sourceFileName source projectOptions
Parameters:
FSharpChecker
sourceFileName : string
source : string
projectOptions : FSharpProjectOptions
Returns: Async<Result<AnalysisResult, string>>
|
Parse and analyze a single F# source string using project options.
|
Full Usage:
analyzeSourceWithSnapshot checker sourceFileName source projectSnapshot
Parameters:
FSharpChecker
sourceFileName : string
source : string
projectSnapshot : FSharpProjectSnapshot
Returns: Async<Result<AnalysisResult, string>>
|
Parse and analyze a single F# source file using a project snapshot. FCS internally caches results for files with unchanged version strings.
|
Full Usage:
collectModuleBindingRanges tree
Parameters:
ParsedInput
Returns: (string * range) list
|
Walk the parsed AST to collect module-level binding names and their full ranges. Each binding's range covers from the `let` keyword to the end of its body, which correctly encompasses nested local bindings.
|
Full Usage:
collectTypeDefnRanges tree
Parameters:
ParsedInput
Returns: (string * range) list
|
Walk the parsed AST to collect type definition names and their full ranges. Each type's range covers from the `type` keyword through all cases/fields/members.
|
Full Usage:
collectTypeMemberRanges tree
Parameters:
ParsedInput
Returns: (string * range) list
|
Walk the parsed AST to collect type member binding names and their full ranges. This enables `findEnclosing` to attribute symbol uses inside type members (e.g. class-based xUnit test methods) to the correct enclosing member.
|
Full Usage:
createProjectSnapshot projectOptions
Parameters:
FSharpProjectOptions
Returns: Async<FSharpProjectSnapshot>
|
Create a project snapshot from project options, using file modification times as version keys. FCS uses version strings to skip re-checking files that haven't changed.
|
Full Usage:
getScriptOptions checker sourceFileName source
Parameters:
FSharpChecker
sourceFileName : string
source : string
Returns: Async<FSharpProjectOptions>
|
Convenience: create project options from a script source string. Detects 'open' statements and includes related script files in the SourceFiles array.
|
Full Usage:
normalizeSymbolPaths repoRoot symbols
Parameters:
string
symbols : SymbolInfo list
Returns: SymbolInfo list
|
Normalize symbol source paths from absolute to repo-relative.
|
TestPrune