Skip to content

Commit

Permalink
Use GetText() to get original attributes from impl file.
Browse files Browse the repository at this point in the history
  • Loading branch information
dawedawe authored and nojaf committed May 24, 2023
1 parent 9713991 commit de6092e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ type FSharpGenerateSignatureBuilder() =
if isNotNull symbolUse then
let mfv = symbolUse.Symbol :?> FSharpMemberOrFunctionOrValue

mfv.Attributes
|> Seq.iter (fun a -> sb.Append($"{a.Format(symbolUse.DisplayContext)}{lineEnding}") |> ignore)
binding.Attributes
|> Seq.iter (fun a -> sb.Append($"[<{a.GetText()}>]{lineEnding}") |> ignore)

sb.Append("val ") |> ignore
sb.Append(binding.HeadPattern.GetText()) |> ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ let c = Math.PI
let d = 23
let e = "bar"
let f x y = x * y
[<BAttribute(MyEnum.A)>]
[<System.Obsolete "foo">]
[<System.NonSerialized>]
let g x = x
let [<Literal>] Hello = "Hello"
[<CompiledName(Hello)>]
let hello = 1
{caret}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ val c: float
val d: int
val e: string
val f: int -> int -> int
[<Obsolete ("foo")>]
[<NonSerialized>]
val g: 'a -> 'a
[<BAttribute(MyEnum.A)>]
[<System.Obsolete "foo">]
[<System.NonSerialized>]
val g: 'a -> 'a
[<Literal>]
val Hello: string
[<CompiledName(Hello)>]
val hello: int

0 comments on commit de6092e

Please sign in to comment.