File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -24,5 +24,23 @@ public static Range ToRange(this IScriptExtent extent)
24
24
extent . EndLineNumber ,
25
25
extent . EndColumnNumber ) ;
26
26
}
27
+
28
+ public static ParameterAst [ ] GetParameterAsts (
29
+ this FunctionDefinitionAst functionDefinitionAst ,
30
+ out ParamBlockAst paramBlockAst )
31
+ {
32
+ paramBlockAst = null ;
33
+ if ( functionDefinitionAst . Parameters != null )
34
+ {
35
+ return new List < ParameterAst > ( functionDefinitionAst . Parameters ) . ToArray ( ) ;
36
+ }
37
+ else if ( functionDefinitionAst . Body . ParamBlock ? . Parameters != null )
38
+ {
39
+ paramBlockAst = functionDefinitionAst . Body . ParamBlock ;
40
+ return new List < ParameterAst > ( functionDefinitionAst . Body . ParamBlock . Parameters ) . ToArray ( ) ;
41
+ }
42
+
43
+ return null ;
44
+ }
27
45
}
28
46
}
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ private List<DiagnosticRecord> FindViolations()
65
65
int whatIfIndex , confirmIndex ;
66
66
ParameterAst whatIfParamAst , confirmParamAst ;
67
67
ParamBlockAst paramBlockAst ;
68
- ParameterAst [ ] parameterAsts = GetParameters ( functionDefinitionAst , out paramBlockAst ) ;
68
+ ParameterAst [ ] parameterAsts = functionDefinitionAst . GetParameterAsts ( out paramBlockAst ) ;
69
69
if ( parameterAsts == null )
70
70
{
71
71
continue ;
@@ -110,24 +110,6 @@ private List<DiagnosticRecord> FindViolations()
110
110
return diagnosticRecords ;
111
111
}
112
112
113
- private static ParameterAst [ ] GetParameters (
114
- FunctionDefinitionAst functionDefinitionAst ,
115
- out ParamBlockAst paramBlockAst )
116
- {
117
- paramBlockAst = null ;
118
- if ( functionDefinitionAst . Parameters != null )
119
- {
120
- return new List < ParameterAst > ( functionDefinitionAst . Parameters ) . ToArray ( ) ;
121
- }
122
- else if ( functionDefinitionAst . Body . ParamBlock ? . Parameters != null )
123
- {
124
- paramBlockAst = functionDefinitionAst . Body . ParamBlock ;
125
- return new List < ParameterAst > ( functionDefinitionAst . Body . ParamBlock . Parameters ) . ToArray ( ) ;
126
- }
127
-
128
- return null ;
129
- }
130
-
131
113
private List < CorrectionExtent > GetCorrections (
132
114
int whatIfIndex ,
133
115
int confirmIndex ,
You can’t perform that action at this time.
0 commit comments