File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/PowerShellEditorServices/Workspace Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -648,7 +648,16 @@ private void ParseFileContents()
648648 . Select ( ScriptFileMarker . FromParseError )
649649 . ToArray ( ) ;
650650
651- //Get all dot sourced referenced files and store them
651+ // Untitled files have no directory
652+ // Discussed in https://github.com/PowerShell/PowerShellEditorServices/pull/815.
653+ // Rather than working hard to enable things for untitled files like a phantom directory,
654+ // users should save the file.
655+ if ( IsUntitledPath ( this . FilePath ) )
656+ {
657+ return ;
658+ }
659+
660+ // Get all dot sourced referenced files and store them
652661 this . ReferencedFiles = AstOperations . FindDotSourcedIncludes ( this . ScriptAst , Path . GetDirectoryName ( this . FilePath ) ) ;
653662 }
654663
You can’t perform that action at this time.
0 commit comments