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(
197197
198198 /// <summary>
199199 /// Finds all the occurrences of a symbol in the script given a file location.
200+ /// TODO: Doesn't support aliases, is it worth it?
200201 /// </summary>
201202 public static IEnumerable < SymbolReference > FindOccurrencesInFile (
202203 ScriptFile scriptFile , int line , int column ) => scriptFile
Original file line number Diff line number Diff line change @@ -358,8 +358,11 @@ public void FindsOccurrencesOnParameter()
358358 [ Fact ]
359359 public async Task FindsReferencesOnCommandWithAlias ( )
360360 {
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 ) ) ,
363366 ( i ) => Assert . Equal ( "Get-ChildItem" , i . SymbolName ) ,
364367 ( i ) => Assert . Equal ( "gci" , i . SymbolName ) ,
365368 ( i ) => Assert . Equal ( "dir" , i . SymbolName ) ,
You can’t perform that action at this time.
0 commit comments