File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/PowerShellEditorServices/Language Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 12
12
using System . Linq ;
13
13
using System . Management . Automation ;
14
14
using System . Management . Automation . Language ;
15
+ using System . Runtime . InteropServices ;
15
16
using System . Threading ;
16
17
using System . Threading . Tasks ;
17
18
@@ -308,24 +309,23 @@ public async Task<FindReferencesResult> FindReferencesOfSymbol(
308
309
await GetAliases ( ) ;
309
310
310
311
// We want to look for references first in referenced files, hence we use ordered dictionary
311
- var fileMap = new OrderedDictionary ( StringComparer . OrdinalIgnoreCase ) ;
312
+ // TODO: File system case-sensitivity is based on filesystem not OS, but OS is a much cheaper heuristic
313
+ var fileMap = RuntimeInformation . IsOSPlatform ( OSPlatform . Linux )
314
+ ? new OrderedDictionary ( )
315
+ : new OrderedDictionary ( StringComparer . OrdinalIgnoreCase ) ;
312
316
foreach ( ScriptFile file in referencedFiles )
313
317
{
314
318
fileMap . Add ( file . FilePath , file ) ;
315
319
}
316
320
317
- IEnumerable < string > allFiles = workspace . EnumeratePSFiles ( ) ;
318
- foreach ( string file in allFiles )
321
+ foreach ( string file in workspace . EnumeratePSFiles ( ) )
319
322
{
320
323
if ( ! fileMap . Contains ( file ) )
321
324
{
322
325
ScriptFile scriptFile ;
323
326
try
324
327
{
325
- scriptFile = new ScriptFile (
326
- file ,
327
- clientFilePath : null ,
328
- powerShellVersion : this . powerShellContext . LocalPowerShellVersion . Version ) ;
328
+ scriptFile = workspace . GetFile ( file ) ;
329
329
}
330
330
catch ( IOException )
331
331
{
You can’t perform that action at this time.
0 commit comments