@@ -43,7 +43,7 @@ type CodeGenerationService(checker: FSharpCompilerServiceChecker, state: State)
4343 override x.GetSymbolAtPosition ( fileName , pos : Position ) =
4444 match state.TryGetFileCheckerOptionsWithLinesAndLineStr( fileName, pos) with
4545 | ResultOrString.Error _ -> None
46- | ResultOrString.Ok ( opts, lines, line) ->
46+ | ResultOrString.Ok( opts, lines, line) ->
4747 try
4848 Lexer.getSymbol pos.Line pos.Column line SymbolLookupKind.Fuzzy [||]
4949 with _ ->
@@ -56,7 +56,7 @@ type CodeGenerationService(checker: FSharpCompilerServiceChecker, state: State)
5656 if symbol.Kind = kind then
5757 match state.TryGetFileCheckerOptionsWithLinesAndLineStr( fileName, pos) with
5858 | ResultOrString.Error _ -> return ! None
59- | ResultOrString.Ok ( opts, text, line) ->
59+ | ResultOrString.Ok( opts, text, line) ->
6060 let! result = checker.TryGetRecentCheckResultsForFile( fileName, opts, text)
6161 let symbolUse = result.TryGetSymbolUse pos line
6262 return ! Some( symbol, symbolUse)
@@ -67,7 +67,7 @@ type CodeGenerationService(checker: FSharpCompilerServiceChecker, state: State)
6767 override x.ParseFileInProject ( fileName ) =
6868 match state.TryGetFileCheckerOptionsWithLines fileName with
6969 | ResultOrString.Error _ -> None
70- | ResultOrString.Ok ( opts, text) ->
70+ | ResultOrString.Ok( opts, text) ->
7171 try
7272 checker.TryGetRecentCheckResultsForFile( fileName, opts, text)
7373 |> Option.map ( fun n -> n.GetParseResults)
@@ -278,17 +278,17 @@ module CodeGenerationUtils =
278278 let args , namesWithIndices =
279279 args
280280 |> List.fold
281- ( fun ( argsSoFar : string list list , namesWithIndices ) args ->
282- let argsSoFar ' , namesWithIndices =
283- args
284- |> List.fold
285- ( fun ( acc : string list , allNames ) arg ->
286- let name , allNames = formatArgUsage ctx hasTypeAnnotation allNames arg
287- name :: acc, allNames)
288- ([], namesWithIndices)
289-
290- List.rev argsSoFar' :: argsSoFar, namesWithIndices)
291- ([], Map.ofList [ ctx.ObjectIdent, Set.empty ])
281+ ( fun ( argsSoFar : string list list , namesWithIndices ) args ->
282+ let argsSoFar ' , namesWithIndices =
283+ args
284+ |> List.fold
285+ ( fun ( acc : string list , allNames ) arg ->
286+ let name , allNames = formatArgUsage ctx hasTypeAnnotation allNames arg
287+ name :: acc, allNames)
288+ ([], namesWithIndices)
289+
290+ List.rev argsSoFar' :: argsSoFar, namesWithIndices)
291+ ([], Map.ofList [ ctx.ObjectIdent, Set.empty ])
292292
293293 args
294294 |> List.rev
@@ -313,7 +313,7 @@ module CodeGenerationUtils =
313313
314314 let argInfos , retType =
315315 match argInfos, v.IsPropertyGetterMethod, v.IsPropertySetterMethod with
316- | [ AllAndLast ( args, last) ], _, true -> [ args ], Some last.Type
316+ | [ AllAndLast( args, last) ], _, true -> [ args ], Some last.Type
317317 | [ [] ], true , _ -> [], Some retType
318318 | _, _, _ -> argInfos, Some retType
319319
@@ -440,7 +440,7 @@ module CodeGenerationUtils =
440440 if m.IsDispatchSlot then " override " else " member "
441441
442442 match m with
443- | MemberInfo.PropertyGetSet ( getter, setter) ->
443+ | MemberInfo.PropertyGetSet( getter, setter) ->
444444 let ( usage , modifiers , getterArgInfos , retType ) = preprocess ctx getter
445445 let closeDeclaration = closeDeclaration retType
446446 let writeImplementation = writeImplementation ctx
@@ -558,7 +558,7 @@ module CodeGenerationUtils =
558558
559559 let (| TypeOfMember | _ |) ( m : FSharpMemberOrFunctionOrValue ) =
560560 match m.FullTypeSafe with
561- | Some ( MemberFunctionType typ) when m.IsProperty && m.DeclaringEntity.IsSome && m.DeclaringEntity.Value.IsFSharp ->
561+ | Some( MemberFunctionType typ) when m.IsProperty && m.DeclaringEntity.IsSome && m.DeclaringEntity.Value.IsFSharp ->
562562 Some typ
563563 | Some typ -> Some typ
564564 | None -> None
@@ -640,7 +640,7 @@ module CodeGenerationUtils =
640640
641641 let (| LongIdentPattern | _ |) =
642642 function
643- | SynPat.LongIdent( longDotId = LongIdentWithDots ( xs, _)) ->
643+ | SynPat.LongIdent( longDotId = LongIdentWithDots( xs, _)) ->
644644 // let (name, range) = xs |> List.map (fun x -> x.idText, x.idRange) |> List.last
645645 let last = List.last xs
646646 Some( last.idText, last.idRange)
@@ -651,21 +651,21 @@ module CodeGenerationUtils =
651651 // so we use 'get_' and 'set_' prefix to ensure corresponding symbols are retrieved correctly.
652652 let (| MemberNameAndRange | _ |) =
653653 function
654- | SynBinding ( valData = SynValData ( Some mf, _, _); headPat = LongIdentPattern ( name, range)) when
654+ | SynBinding( valData = SynValData( Some mf, _, _); headPat = LongIdentPattern( name, range)) when
655655 mf.MemberKind = SynMemberKind.PropertyGet
656656 ->
657657 if name.StartsWith( " get_" ) then
658658 Some( name, range)
659659 else
660660 Some( " get_" + name, range)
661- | SynBinding ( valData = SynValData ( Some mf, _, _); headPat = LongIdentPattern ( name, range)) when
661+ | SynBinding( valData = SynValData( Some mf, _, _); headPat = LongIdentPattern( name, range)) when
662662 mf.MemberKind = SynMemberKind.PropertySet
663663 ->
664664 if name.StartsWith( " set_" ) then
665665 Some( name, range)
666666 else
667667 Some( " set_" + name, range)
668- | SynBinding( headPat = LongIdentPattern ( name, range)) -> Some( name, range)
668+ | SynBinding( headPat = LongIdentPattern( name, range)) -> Some( name, range)
669669 | _ -> None
670670
671671 let normalizeEventName ( m : FSharpMemberOrFunctionOrValue ) =
@@ -815,8 +815,8 @@ module CodeGenerationUtils =
815815 ( displayContext : FSharpDisplayContext )
816816 excludedMemberSignatures
817817 ( e : FSharpEntity )
818- ( getMembersToImplement : FSharpEntity
819- -> seq < FSharpMemberOrFunctionOrValue * seq < FSharpGenericParameter * FSharpType >>)
818+ ( getMembersToImplement :
819+ FSharpEntity -> seq < FSharpMemberOrFunctionOrValue * seq < FSharpGenericParameter * FSharpType >>)
820820 verboseMode
821821 =
822822 let lines = String.getLines methodBody
@@ -923,17 +923,17 @@ module CodeGenerationUtils =
923923 let rec (| RationalConst |) =
924924 function
925925 | SynRationalConst.Integer i -> string i
926- | SynRationalConst.Rational ( numerator, denominator, _) -> sprintf " (%i /%i )" numerator denominator
927- | SynRationalConst.Negate ( RationalConst s) -> sprintf " - %s " s
926+ | SynRationalConst.Rational( numerator, denominator, _) -> sprintf " (%i /%i )" numerator denominator
927+ | SynRationalConst.Negate( RationalConst s) -> sprintf " - %s " s
928928
929929 let rec (| TypeIdent | _ |) =
930930 function
931- | SynType.Var ( SynTypar ( s, req, _), _) ->
931+ | SynType.Var( SynTypar( s, req, _), _) ->
932932 match req with
933933 | TyparStaticReq.None -> Some( " '" + s.idText)
934934 | TyparStaticReq.HeadType -> Some( " ^" + s.idText)
935- | SynType.LongIdent ( LongIdentWithDots ( xs, _)) -> xs |> Seq.map ( fun x -> x.idText) |> String.concat " ." |> Some
936- | SynType.App ( t, _, ts, _, _, isPostfix, _) ->
935+ | SynType.LongIdent( LongIdentWithDots( xs, _)) -> xs |> Seq.map ( fun x -> x.idText) |> String.concat " ." |> Some
936+ | SynType.App( t, _, ts, _, _, isPostfix, _) ->
937937 match t, ts with
938938 | TypeIdent typeName, [] -> Some typeName
939939 | TypeIdent typeName, [ TypeIdent typeArg ] ->
@@ -952,15 +952,15 @@ module CodeGenerationUtils =
952952 debug " Unsupported case with %A and %A " t ts
953953 None
954954 | SynType.Anon _ -> Some " _"
955- | SynType.Tuple (_, ts, _) -> Some( ts |> Seq.choose ( snd >> (| TypeIdent|_|)) |> String.concat " * " )
956- | SynType.Array ( dimension, TypeIdent typeName, _) -> Some( sprintf " %s [%s ]" typeName ( String( ',' , dimension - 1 )))
957- | SynType.MeasurePower ( TypeIdent typeName, RationalConst power, _) -> Some( sprintf " %s ^%s " typeName power)
958- | SynType.MeasureDivide ( TypeIdent numerator, TypeIdent denominator, _) ->
955+ | SynType.Tuple(_, ts, _) -> Some( ts |> Seq.choose ( snd >> (| TypeIdent|_|)) |> String.concat " * " )
956+ | SynType.Array( dimension, TypeIdent typeName, _) -> Some( sprintf " %s [%s ]" typeName ( String( ',' , dimension - 1 )))
957+ | SynType.MeasurePower( TypeIdent typeName, RationalConst power, _) -> Some( sprintf " %s ^%s " typeName power)
958+ | SynType.MeasureDivide( TypeIdent numerator, TypeIdent denominator, _) ->
959959 Some( sprintf " %s /%s " numerator denominator)
960960 | _ -> None
961961
962962 let expandTypeParameters ( typ : SynType ) =
963963 match typ with
964- | SynType.App (_, _, ts, _, _, _, _)
965- | SynType.LongIdentApp (_, _, _, ts, _, _, _) -> ts |> Seq.choose (| TypeIdent|_|) |> Seq.toArray
964+ | SynType.App(_, _, ts, _, _, _, _)
965+ | SynType.LongIdentApp(_, _, _, ts, _, _, _) -> ts |> Seq.choose (| TypeIdent|_|) |> Seq.toArray
966966 | _ -> [||]
0 commit comments