File tree Expand file tree Collapse file tree
test/PowerShellEditorServices.Test/Refactoring Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111using Microsoft . PowerShell . EditorServices . Test . Shared ;
1212using Microsoft . PowerShell . EditorServices . Handlers ;
1313using Xunit ;
14- using Microsoft . PowerShell . EditorServices . Refactoring ;
1514using System . Management . Automation . Language ;
15+ using Microsoft . PowerShell . EditorServices . Refactoring ;
1616
1717namespace PowerShellEditorServices . Test . Refactoring
1818{
@@ -133,5 +133,21 @@ public void GetCommandParameterAst()
133133 Assert . Equal ( 10 , symbol . Extent . StartColumnNumber ) ;
134134
135135 }
136+ [ Fact ]
137+ public void GetFunctionDefinitionAst ( )
138+ {
139+ RenameSymbolParams request = new ( ) {
140+ Column = 12 ,
141+ Line = 1 ,
142+ RenameTo = "Renamed" ,
143+ FileName = "TestDetection.ps1"
144+ } ;
145+ ScriptFile scriptFile = GetTestScript ( request . FileName ) ;
146+
147+ Ast symbol = Utilities . GetAst ( request . Line , request . Column , scriptFile . ScriptAst ) ;
148+ Assert . Equal ( 1 , symbol . Extent . StartLineNumber ) ;
149+ Assert . Equal ( 1 , symbol . Extent . StartColumnNumber ) ;
150+
151+ }
136152 }
137153}
You can’t perform that action at this time.
0 commit comments