@@ -11,73 +11,91 @@ open FSharp.Compiler.Symbols
11
11
open FSharp.Compiler .Text
12
12
open FSharp.Compiler .DiagnosticsLogger
13
13
14
+ /// Information about the context of a type equation in type-mismatch-like diagnostic
14
15
[<RequireQualifiedAccess; Experimental( " This FCS API is experimental and subject to change." ) >]
15
16
type public DiagnosticContextInfo =
16
- /// No context was given.
17
+ /// No context was given
17
18
| NoContext
18
- /// The type equation comes from an IF expression.
19
+ /// The type equation comes from an IF expression
19
20
| IfExpression
20
- /// The type equation comes from an omitted else branch.
21
+ /// The type equation comes from an omitted else branch
21
22
| OmittedElseBranch
22
- /// The type equation comes from a type check of the result of an else branch.
23
+ /// The type equation comes from a type check of the result of an else branch
23
24
| ElseBranchResult
24
- /// The type equation comes from the verification of record fields.
25
+ /// The type equation comes from the verification of record fields
25
26
| RecordFields
26
- /// The type equation comes from the verification of a tuple in record fields.
27
+ /// The type equation comes from the verification of a tuple in record fields
27
28
| TupleInRecordFields
28
29
/// The type equation comes from a list or array constructor
29
30
| CollectionElement
30
- /// The type equation comes from a return in a computation expression.
31
+ /// The type equation comes from a return in a computation expression
31
32
| ReturnInComputationExpression
32
- /// The type equation comes from a yield in a computation expression.
33
+ /// The type equation comes from a yield in a computation expression
33
34
| YieldInComputationExpression
34
- /// The type equation comes from a runtime type test.
35
+ /// The type equation comes from a runtime type test
35
36
| RuntimeTypeTest
36
- /// The type equation comes from an downcast where a upcast could be used.
37
+ /// The type equation comes from an downcast where a upcast could be used
37
38
| DowncastUsedInsteadOfUpcast
38
- /// The type equation comes from a return type of a pattern match clause (not the first clause).
39
+ /// The type equation comes from a return type of a pattern match clause (not the first clause)
39
40
| FollowingPatternMatchClause
40
- /// The type equation comes from a pattern match guard.
41
+ /// The type equation comes from a pattern match guard
41
42
| PatternMatchGuard
42
- /// The type equation comes from a sequence expression.
43
+ /// The type equation comes from a sequence expression
43
44
| SequenceExpression
44
45
46
+ /// Contextually-relevant data to each particular diagnostic
45
47
[<Interface; Experimental( " This FCS API is experimental and subject to change." ) >]
46
- type public IFSharpDiagnosticExtendedData =
47
- interface
48
- end
48
+ type public IFSharpDiagnosticExtendedData = interface end
49
49
50
+ /// Additional data for type-mismatch-like (usually with ErrorNumber = 1) diagnostics
50
51
[<Class; Experimental( " This FCS API is experimental and subject to change." ) >]
51
52
type public TypeMismatchDiagnosticExtendedData =
52
53
interface IFSharpDiagnosticExtendedData
54
+ /// Represents F# type expected in the current context
53
55
member ExpectedType : FSharpType
56
+ /// Represents F# type type actual in the current context
54
57
member ActualType : FSharpType
58
+ /// The context in which the type mismatch was found
55
59
member ContextInfo : DiagnosticContextInfo
60
+ /// Represents the information needed to format types
56
61
member DisplayContext : FSharpDisplayContext
57
62
63
+ /// Additional data for 'This expression is a function value, i.e. is missing arguments' diagnostic
58
64
[<Class; Experimental( " This FCS API is experimental and subject to change." ) >]
59
65
type public ExpressionIsAFunctionExtendedData =
60
66
interface IFSharpDiagnosticExtendedData
67
+ /// Represents F# type of the expression
61
68
member ActualType : FSharpType
62
69
70
+ /// Additional data for diagnostics about a field whose declarations differ in signature and implementation
63
71
[<Class; Experimental( " This FCS API is experimental and subject to change." ) >]
64
72
type public FieldNotContainedDiagnosticExtendedData =
65
73
interface IFSharpDiagnosticExtendedData
74
+ /// Represents F# field in signature file
66
75
member SignatureField : FSharpField
76
+ /// Represents F# field in implementation file
67
77
member ImplementationField : FSharpField
68
78
79
+ /// Additional data for diagnostics about a value whose declarations differ in signature and implementation
69
80
[<Class; Experimental( " This FCS API is experimental and subject to change." ) >]
70
81
type public ValueNotContainedDiagnosticExtendedData =
71
82
interface IFSharpDiagnosticExtendedData
83
+ /// Represents F# value in signature file
72
84
member SignatureValue : FSharpMemberOrFunctionOrValue
85
+ /// Represents F# value in implementation file
73
86
member ImplementationValue : FSharpMemberOrFunctionOrValue
74
87
88
+ /// Additional data for 'argument names in the signature and implementation do not match' diagnostic
75
89
[<Class; Experimental( " This FCS API is experimental and subject to change." ) >]
76
90
type ArgumentsInSigAndImplMismatchExtendedData =
77
91
interface IFSharpDiagnosticExtendedData
92
+ /// Argument name in signature file
78
93
member SignatureName : string
94
+ /// Argument name in implementation file
79
95
member ImplementationName : string
96
+ /// Argument identifier range within signature file
80
97
member SignatureRange : range
98
+ /// Argument identifier range within implementation file
81
99
member ImplementationRange : range
82
100
83
101
/// Represents a diagnostic produced by the F# compiler
@@ -126,6 +144,7 @@ type public FSharpDiagnostic =
126
144
/// Gets the full error number text e.g "FS0031"
127
145
member ErrorNumberText : string
128
146
147
+ /// Gets the contextually-relevant data to each particular diagnostic for things like code fixes
129
148
[<Experimental( " This FCS API is experimental and subject to change." ) >]
130
149
member ExtendedData : IFSharpDiagnosticExtendedData option
131
150
0 commit comments