Header menu logo F# Compiler Guide

PatternContext Type

Union cases

Union case Description

NamedUnionCaseField(fieldName, caseIdRange)

Full Usage: NamedUnionCaseField(fieldName, caseIdRange)

Parameters:
    fieldName : string
    caseIdRange : range

Completing union case field pattern (e.g. fun (Some (Value = v| )) -> )

fieldName : string
caseIdRange : range

Other

Full Usage: Other

Any other position in a pattern that does not need special handling

PositionalUnionCaseField(fieldIndex, isTheOnlyField, caseIdRange)

Full Usage: PositionalUnionCaseField(fieldIndex, isTheOnlyField, caseIdRange)

Parameters:
    fieldIndex : int option - Position in the tuple. None if there is no tuple, with only one field outside of parentheses - `Some v|`
    isTheOnlyField : bool - True when completing the first field in the tuple and no other field is bound - `Case (a|)` but not `Case (a|, b)`
    caseIdRange : range - Range of the case identifier

Completing union case field pattern (e.g. fun (Some v| ) -> ) or fun (Some (v| )) -> ). In theory, this could also be parameterized active pattern usage.

fieldIndex : int option

Position in the tuple. None if there is no tuple, with only one field outside of parentheses - `Some v|`

isTheOnlyField : bool

True when completing the first field in the tuple and no other field is bound - `Case (a|)` but not `Case (a|, b)`

caseIdRange : range

Range of the case identifier

RecordFieldIdentifier referencedFields

Full Usage: RecordFieldIdentifier referencedFields

Parameters:
    referencedFields : (string * range) list

Completing a record field identifier in a pattern (e.g. fun { Field1 = a; Fie| } -> )

referencedFields : (string * range) list

UnionCaseFieldIdentifier(referencedFields, caseIdRange)

Full Usage: UnionCaseFieldIdentifier(referencedFields, caseIdRange)

Parameters:
    referencedFields : string list
    caseIdRange : range

Completing union case field identifier in a pattern (e.g. fun (Case (field1 = a; fie| )) -> )

referencedFields : string list
caseIdRange : range

Type something to start searching.