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()
648
648
. Select ( ScriptFileMarker . FromParseError )
649
649
. ToArray ( ) ;
650
650
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
652
661
this . ReferencedFiles = AstOperations . FindDotSourcedIncludes ( this . ScriptAst , Path . GetDirectoryName ( this . FilePath ) ) ;
653
662
}
654
663
You can’t perform that action at this time.
0 commit comments