File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/PowerShellEditorServices/Symbols Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ private static bool IsPesterCommand(CommandAst commandAst)
9090 private static PesterSymbolReference ConvertPesterAstToSymbolReference ( ScriptFile scriptFile , CommandAst pesterCommandAst )
9191 {
9292 string testLine = scriptFile . GetLine ( pesterCommandAst . Extent . StartLineNumber ) ;
93- string commandName = ( pesterCommandAst . CommandElements [ 0 ] as StringConstantExpressionAst ) ? . Value ;
93+ string commandName = pesterCommandAst . GetCommandName ( ) ;
9494
9595 // Search for a name for the test
9696 string testName = null ;
@@ -159,12 +159,9 @@ public class PesterSymbolReference : SymbolReference
159159 /// Lookup for Pester keywords we support. Ideally we could extract these from Pester itself
160160 /// </summary>
161161 internal static readonly IReadOnlyDictionary < string , PesterCommandType > PesterKeywords =
162- new Dictionary < string , PesterCommandType > ( StringComparer . OrdinalIgnoreCase )
163- {
164- { "Describe" , PesterCommandType . Describe } ,
165- { "Context" , PesterCommandType . Context } ,
166- { "It" , PesterCommandType . It }
167- } ;
162+ Enum . GetValues ( typeof ( PesterCommandType ) )
163+ . Cast < PesterCommandType > ( )
164+ . ToDictionary ( pct => pct . ToString ( ) , pct => pct ) ;
168165
169166 private static char [ ] DefinitionTrimChars = new char [ ] { ' ' , '{' } ;
170167
You can’t perform that action at this time.
0 commit comments