We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e0ee90 commit dd7d4ebCopy full SHA for dd7d4eb
src/PowerShellEditorServices/Workspace/ScriptFile.cs
@@ -648,7 +648,16 @@ private void ParseFileContents()
648
.Select(ScriptFileMarker.FromParseError)
649
.ToArray();
650
651
- //Get all dot sourced referenced files and store them
+ // 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
661
this.ReferencedFiles = AstOperations.FindDotSourcedIncludes(this.ScriptAst, Path.GetDirectoryName(this.FilePath));
662
}
663
0 commit comments