File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
ReSharper.FSharp/src/FSharp.Psi/src/Resolve Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -145,5 +145,19 @@ public static IEnumerable<IEnumerable<string>> GetParameterNames(this ITypeUsage
145145 ITupleTypeUsage tuplePat => tuplePat . Items . SelectMany ( GetParameterNames ) ,
146146 _ => EmptyList < IEnumerable < string > > . Enumerable
147147 } ;
148+
149+ public static IReadOnlyList < IReadOnlyList < string > > GetParametersGroups ( this IBinding binding )
150+ {
151+ var parameters = binding . ParameterPatterns . Select ( GetParameterNames ) ;
152+ var bodyExpr = binding . Expression ;
153+
154+ while ( bodyExpr . IgnoreInnerParens ( ) is ILambdaExpr lambdaExpr )
155+ {
156+ parameters = parameters . Union ( lambdaExpr . Patterns . Select ( GetParameterNames ) ) ;
157+ bodyExpr = lambdaExpr . Expression ;
158+ }
159+
160+ return parameters . Select ( t => t . ToIReadOnlyList ( ) ) . ToIReadOnlyList ( ) ;
161+ }
148162 }
149163}
You can’t perform that action at this time.
0 commit comments