Skip to content

Commit

Permalink
Merge pull request #950 from MangelMaxime/fix/duplicate_member_extension
Browse files Browse the repository at this point in the history
fix: remove duplicated `Type Extensions`
  • Loading branch information
nojaf authored Jan 3, 2025
2 parents ae05ce5 + 532007c commit 7b20db4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FSharp.Formatting.ApiDocs/GenerateModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2737,6 +2737,11 @@ module internal SymbolReader =
let exts, nsdocs2 =
readMembers ctx entityUrl ApiDocMemberKind.TypeExtension modul (fun v -> v.IsExtensionMember)

// `with get and set` syntax is sugar for a mutable field, a get binding and a set binding
// This result in duplicated Method Extensions, we use DeclarationLocation to keep only one
// See https://github.com/fsprojects/FSharp.Formatting/issues/941
let exts = exts |> List.distinctBy (fun m -> m.Symbol.DeclarationLocation)

let pats, nsdocs3 =
readMembers ctx entityUrl ApiDocMemberKind.ActivePattern modul (fun v -> v.IsActivePattern)

Expand Down

0 comments on commit 7b20db4

Please sign in to comment.