File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,21 +261,23 @@ private static CorrectionExtent GetCorrectionExtent(ParamBlockAst paramBlockAst)
261261 {
262262
263263 string correctionText = new String ( ' ' , paramBlockAst . Extent . StartColumnNumber - 1 )
264- + "CmdletBinding(SupportsShouldProcess)"
264+ + "[ CmdletBinding(SupportsShouldProcess)] "
265265 + Environment . NewLine ;
266266
267267 return new CorrectionExtent (
268268 paramBlockAst . Extent . StartLineNumber ,
269- paramBlockAst . Extent . EndLineNumber ,
269+ paramBlockAst . Extent . StartLineNumber ,
270270 1 ,
271271 1 ,
272272 correctionText ,
273273 null ) ;
274274 }
275275 private static CorrectionExtent GetCorrectionExtent ( AttributeAst cmdletBindingAttributeAst )
276276 {
277- // 1 for 1 based offset and 1 for the next position.
278- var startColumnNumber = cmdletBindingAttributeAst . Extent . Text . IndexOf ( "(" ) + 2 ;
277+ // 1 for the next position.
278+ var startColumnNumber = cmdletBindingAttributeAst . Extent . Text . IndexOf ( "(" )
279+ + cmdletBindingAttributeAst . Extent . StartColumnNumber
280+ + 1 ;
279281 var extent = cmdletBindingAttributeAst . Extent ;
280282 var suffix = cmdletBindingAttributeAst . NamedArguments . Count > 0
281283 || cmdletBindingAttributeAst . PositionalArguments . Count > 0
You can’t perform that action at this time.
0 commit comments