Skip to content

Commit 8561a9c

Browse files
committed
Merge pull request #296 from 7sharp9/AddOverloads
Add Overloads to the symbols signature so it is publicly visible
2 parents 5bfa88d + b18f302 commit 8561a9c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/fsharp/vs/Symbols.fs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,15 +1034,20 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) =
10341034
| Some v -> Some v.Range
10351035
| None -> base.DeclarationLocation
10361036

1037-
member x.Overloads =
1037+
member x.Overloads matchParameterNumber =
10381038
checkIsResolved()
10391039
match d with
10401040
| M m ->
10411041
match item with
1042-
| Item.MethodGroup (_name, methodInfos) ->
1043-
methodInfos
1044-
|> List.filter (fun methodInfo -> not (methodInfo.NumArgs = m.NumArgs) )
1042+
| Item.MethodGroup (_name, methodInfos) ->
1043+
let methods =
1044+
if matchParameterNumber then
1045+
methodInfos
1046+
|> List.filter (fun methodInfo -> not (methodInfo.NumArgs = m.NumArgs) )
1047+
else methodInfos
1048+
methods
10451049
|> List.map (fun mi -> FSharpMemberOrFunctionOrValue(cenv, M mi, item))
1050+
|> makeReadOnlyCollection
10461051
|> Some
10471052
| _ -> None
10481053
| _ -> None

src/fsharp/vs/Symbols.fsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,10 @@ and [<Class>] FSharpMemberOrFunctionOrValue =
682682

683683
member CurriedParameterGroups : IList<IList<FSharpParameter>>
684684

685+
/// Gets the overloads for the current method
686+
/// matchParameterNumber indicates whether to filter the overloads to match the number of parameters in the current symbol
687+
member Overloads : bool -> IList<FSharpMemberOrFunctionOrValue> option
688+
685689
member ReturnParameter : FSharpParameter
686690

687691
/// Custom attributes attached to the value. These contain references to other values (i.e. constructors in types). Mutable to fixup

0 commit comments

Comments
 (0)