File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
tests/FSharp.Compiler.Service.Tests Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -1929,6 +1929,15 @@ let hasRecordField (fieldName:string) (symbolUses: FSharpSymbolUse list) =
19291929 )
19301930 |> fun exists -> Assert.True( exists, $" Field {fieldName} not found." )
19311931
1932+ let notHasRecordField ( fieldName : string ) ( symbolUses : FSharpSymbolUse list ) =
1933+ symbolUses
1934+ |> List.exists ( fun symbolUse ->
1935+ match symbolUse.Symbol with
1936+ | :? FSharpField as field -> field.DisplayName = fieldName
1937+ | _ -> false
1938+ )
1939+ |> fun exists -> Assert.False( exists, $" Field {fieldName} should not be found." )
1940+
19321941let hasRecordType ( recordTypeName : string ) ( symbolUses : FSharpSymbolUse list ) =
19331942 symbolUses
19341943 |> List.exists ( fun symbolUse ->
@@ -2144,3 +2153,34 @@ let rUpdate = { r1 with Fi }
21442153
21452154 hasRecordField " Field1" declarations
21462155 hasRecordField " Field2" declarations
2156+
2157+ [<Fact>]
2158+ let ``No record fields are completed before 'with ' in update record`` () =
2159+ let parseResults , checkResults =
2160+ getParseAndCheckResults """
2161+ module Module
2162+
2163+ type T =
2164+ { AAA: int }
2165+
2166+ let r = { AAA = 5 }
2167+
2168+ let b = { r with }
2169+ """
2170+
2171+ let declarations =
2172+ checkResults.GetDeclarationListSymbols(
2173+ Some parseResults,
2174+ 9 ,
2175+ " let b = { r with }" ,
2176+ {
2177+ EndColumn = 12
2178+ LastDotPos = None
2179+ PartialIdent = " "
2180+ QualifyingIdents = []
2181+ },
2182+ fun _ -> List.empty
2183+ )
2184+ |> List.concat
2185+
2186+ notHasRecordField " AAA" declarations
You can’t perform that action at this time.
0 commit comments