File tree 1 file changed +4
-7
lines changed
src/PowerShellEditorServices/Symbols 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)
90
90
private static PesterSymbolReference ConvertPesterAstToSymbolReference ( ScriptFile scriptFile , CommandAst pesterCommandAst )
91
91
{
92
92
string testLine = scriptFile . GetLine ( pesterCommandAst . Extent . StartLineNumber ) ;
93
- string commandName = ( pesterCommandAst . CommandElements [ 0 ] as StringConstantExpressionAst ) ? . Value ;
93
+ string commandName = pesterCommandAst . GetCommandName ( ) ;
94
94
95
95
// Search for a name for the test
96
96
string testName = null ;
@@ -159,12 +159,9 @@ public class PesterSymbolReference : SymbolReference
159
159
/// Lookup for Pester keywords we support. Ideally we could extract these from Pester itself
160
160
/// </summary>
161
161
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 ) ;
168
165
169
166
private static char [ ] DefinitionTrimChars = new char [ ] { ' ' , '{' } ;
170
167
You can’t perform that action at this time.
0 commit comments