Skip to content

Commit

Permalink
* style: add space after colon in type annotations in AddExplicitRetu…
Browse files Browse the repository at this point in the history
…rnType.fs and AddExplicitReturnTypeTests.fs
  • Loading branch information
SebastianAtWork committed Nov 20, 2023
1 parent 47553a8 commit a4a837a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type internal AddExplicitReturnType [<ImportingConstructor>] () =
let textChange =
rangeOfReturnType
|> Option.map (fun range -> RoslynHelpers.FSharpRangeToTextSpan(sourceText, range))
|> Option.map (fun textSpan -> TextChange(textSpan, $":{inferredType}"))
|> Option.map (fun textSpan -> TextChange(textSpan, $": {inferredType}"))

match textChange with
| Some textChange -> sourceText.WithChanges(textChange)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let sum a b = a + b

let expectedCode =
$"""
let sum a b :int= a + b
let sum a b : int= a + b
"""

let resultText = newDoc.GetTextAsync context.CT |> GetTaskResult
Expand All @@ -67,7 +67,7 @@ let sum (a:float) (b:float) = a + b

let expectedCode =
"""
let sum (a:float) (b:float) :float= a + b
let sum (a:float) (b:float) : float= a + b
"""

let resultText = newDoc.GetTextAsync context.CT |> GetTaskResult
Expand All @@ -92,7 +92,7 @@ let rec fib n =

let expectedCode =
$"""
let rec fib n :int=
let rec fib n : int=
if n < 2 then 1
else fib (n - 1) + fib (n - 2)
"""
Expand All @@ -117,7 +117,7 @@ let apply1 (transform: int -> int) y = transform y

let expectedCode =
$"""
let apply1 (transform: int -> int) y :int= transform y
let apply1 (transform: int -> int) y : int= transform y
"""

let resultText = newDoc.GetTextAsync context.CT |> GetTaskResult
Expand All @@ -144,7 +144,7 @@ type SomeType(factor0: int) =
$"""
type SomeType(factor0: int) =
let factor = factor0
member this.SomeMethod(a, b, c) :int= (a + b + c) * factor
member this.SomeMethod(a, b, c) : int= (a + b + c) * factor
"""

let resultText = newDoc.GetTextAsync context.CT |> GetTaskResult
Expand All @@ -169,7 +169,7 @@ let sum a b = {Value=a+b}
let expectedCode =
"""
type MyType = { Value: int }
let sum a b :MyType= {Value=a+b}
let sum a b : MyType= {Value=a+b}
"""

let resultText = newDoc.GetTextAsync context.CT |> GetTaskResult
Expand Down Expand Up @@ -202,7 +202,7 @@ let sum a b = {Value=a+b}
"""
open MyModule
let sum a b :MyType= {Value=a+b}
let sum a b : MyType= {Value=a+b}
"""

let resultText = newDoc.GetTextAsync context.CT |> GetTaskResult
Expand Down

0 comments on commit a4a837a

Please sign in to comment.