File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/PowerShellEditorServices/Workspace Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,6 @@ private void RecursivelyFindReferences(
408408 GetBaseFilePath (
409409 scriptFile . FilePath ) ;
410410
411- ScriptFile referencedFile ;
412411 foreach ( string referencedFileName in scriptFile . ReferencedFiles )
413412 {
414413 string resolvedScriptPath =
@@ -429,12 +428,9 @@ private void RecursivelyFindReferences(
429428 referencedFileName ,
430429 resolvedScriptPath ) ) ;
431430
432- // Make sure file exists before trying to get the file
433- if ( File . Exists ( resolvedScriptPath ) )
431+ // Get the referenced file if it's not already in referencedScriptFiles
432+ if ( this . TryGetFile ( resolvedScriptPath , out ScriptFile referencedFile ) )
434433 {
435- // Get the referenced file if it's not already in referencedScriptFiles
436- referencedFile = this . GetFile ( resolvedScriptPath ) ;
437-
438434 // Normalize the resolved script path and add it to the
439435 // referenced files list if it isn't there already
440436 resolvedScriptPath = resolvedScriptPath . ToLower ( ) ;
You can’t perform that action at this time.
0 commit comments