CodeFormatter Module
Formats F# source code snippets into annotated token sequences by invoking the F# Compiler Service for tokenisation, type-checking, and semantic classification.
Functions and values
| Function or value |
Description
|
Full Usage:
ParseAndCheckSource (file, source, options, defines, onError)
Parameters:
string
source : string
options : string option
defines : string option
onError : string -> unit
Returns: Snippet array * SourceError[]
|
Parse, check and annotate the source code specified by 'source', assuming that it is located in a specified 'file'. Optional arguments can be used to give compiler command line options and preprocessor definitions
|
Full Usage:
categoryToTokenKind _arg1
Parameters:
SemanticClassificationType
Returns: TokenKind option
|
Maps an FCS
|
|
Shared
|
Full Usage:
processDoubleBackticks body
Parameters:
string
Returns: string
|
Converts a double-backtick identifier like
|
Full Usage:
processSnippet checkResults categorizedRanges lines snippet
Parameters:
FSharpCheckFileResults
categorizedRanges : Map<int, 'a>
lines : string array
snippet : Snippet
Returns: Line list
Type parameters: 'a (requires :> FSharp.Compiler.EditorServices.SemanticClassificationItem Microsoft.FSharp.Collections.seq) |
Processes all lines of a snippet using the FCS check results and semantic classification ranges,
returning an annotated list of
|
Full Usage:
processSnippetLine checkResults semanticRanges lines (line, lineTokens)
Parameters:
FSharpCheckFileResults
semanticRanges : SemanticClassificationItem array
lines : string array
line : int
lineTokens : SnippetLine
Returns: Line
|
Processes a single source line: walks the token stream and enriches each token with semantic classification (colour kind and tooltip) from the FCS type-check results.
|
Full Usage:
processSourceCode (filePath, source, options, defines, onError)
Parameters:
string
source : string
options : string option
defines : string option
onError : string -> unit
Returns: Async<Snippet array * SourceError[]>
|
Asynchronously parses, type-checks, and annotates a single F# source file or script, returning an array of named, token-annotated snippets and any compilation diagnostics.
|
FSharp.Formatting