File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/PowerShellEditorServices/Services/PowerShell/Refactoring Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright (c) Microsoft Corporation.
2
2
// Licensed under the MIT License.
3
3
4
+ using System ;
4
5
using System . Collections . Generic ;
5
6
using System . Linq ;
6
7
using System . Management . Automation . Language ;
@@ -10,13 +11,13 @@ namespace Microsoft.PowerShell.EditorServices.Refactoring
10
11
internal class Utilities
11
12
{
12
13
13
- public static Ast LookForParentOfType < T > ( Ast ast )
14
+ public static Ast LookForParentOfType ( Ast ast , params Type [ ] type )
14
15
{
15
- Ast parent = ast . Parent ;
16
+ Ast parent = ast ;
16
17
// walk backwards till we hit a parent of the specified type or return null
17
18
while ( null != parent )
18
19
{
19
- if ( typeof ( T ) == parent . GetType ( ) )
20
+ if ( type . Contains ( parent . GetType ( ) ) )
20
21
{
21
22
return parent ;
22
23
}
You can’t perform that action at this time.
0 commit comments