forked from fsprojects/fantomas
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCodeFormatter.fsi
52 lines (43 loc) · 2.08 KB
/
CodeFormatter.fsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
namespace Fantomas
open Fantomas.FormatConfig
open Fantomas.SourceOrigin
open FSharp.Compiler.Text
open FSharp.Compiler.CodeAnalysis
open FSharp.Compiler.Syntax
[<Sealed>]
type CodeFormatter =
/// Parse a source string using given config
static member ParseAsync:
fileName: string * source: SourceOrigin * parsingOptions: FSharpParsingOptions * checker: FSharpChecker ->
Async<(ParsedInput * string list) array>
/// Format an abstract syntax tree using an optional source for trivia processing
static member FormatASTAsync:
ast: ParsedInput * fileName: string * defines: string list * source: SourceOrigin option * config: FormatConfig ->
Async<string>
/// Format a source string using given config
static member FormatDocumentAsync:
fileName: string *
source: SourceOrigin *
config: FormatConfig *
parsingOptions: FSharpParsingOptions *
checker: FSharpChecker ->
Async<string>
/// Format a part of source string using given config, and return the (formatted) selected part only.
/// Beware that the range argument is inclusive. If the range has a trailing newline, it will appear in the formatted result.
static member FormatSelectionAsync:
fileName: string *
selection: Range *
source: SourceOrigin *
config: FormatConfig *
parsingOptions: FSharpParsingOptions *
checker: FSharpChecker ->
Async<string>
/// Check whether an input string is invalid in F# by looking for erroneous nodes in ASTs
static member IsValidFSharpCodeAsync:
fileName: string * source: SourceOrigin * parsingOptions: FSharpParsingOptions * checker: FSharpChecker ->
Async<bool>
static member IsValidASTAsync: ast: ParsedInput -> Async<bool>
static member MakePos: line: int * col: int -> pos
static member MakeRange: fileName: string * startLine: int * startCol: int * endLine: int * endCol: int -> range
/// Returns the version of Fantomas found in the AssemblyInfo
static member GetVersion: unit -> string