File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/PowerShellEditorServices/Services/Symbols
test/PowerShellEditorServices.Test/Language Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ public async Task<IEnumerable<SymbolReference>> ScanForReferencesOfSymbolAsync(
197
197
198
198
/// <summary>
199
199
/// Finds all the occurrences of a symbol in the script given a file location.
200
+ /// TODO: Doesn't support aliases, is it worth it?
200
201
/// </summary>
201
202
public static IEnumerable < SymbolReference > FindOccurrencesInFile (
202
203
ScriptFile scriptFile , int line , int column ) => scriptFile
Original file line number Diff line number Diff line change @@ -358,8 +358,11 @@ public void FindsOccurrencesOnParameter()
358
358
[ Fact ]
359
359
public async Task FindsReferencesOnCommandWithAlias ( )
360
360
{
361
- List < SymbolReference > referencesResult = await GetReferences ( FindsReferencesOnBuiltInCommandWithAliasData . SourceDetails ) . ConfigureAwait ( true ) ;
362
- Assert . Collection ( referencesResult ,
361
+ // NOTE: This doesn't use GetOccurrences as it's testing for aliases.
362
+ IEnumerable < SymbolReference > symbols = await GetReferences ( FindsReferencesOnBuiltInCommandWithAliasData . SourceDetails ) . ConfigureAwait ( true ) ;
363
+ Assert . Collection ( symbols . Where (
364
+ ( i ) => i . FilePath
365
+ . EndsWith ( FindsReferencesOnBuiltInCommandWithAliasData . SourceDetails . File ) ) ,
363
366
( i ) => Assert . Equal ( "Get-ChildItem" , i . SymbolName ) ,
364
367
( i ) => Assert . Equal ( "gci" , i . SymbolName ) ,
365
368
( i ) => Assert . Equal ( "dir" , i . SymbolName ) ,
You can’t perform that action at this time.
0 commit comments