Skip to content

Commit a799187

Browse files
committed
Fix #312: File preview Uris crash the language server
1 parent d342685 commit a799187

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/PowerShellEditorServices/Workspace/Workspace.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,13 @@ internal static bool IsPathInMemory(string filePath)
264264
// When viewing PowerShell files in the Git diff viewer, VS Code
265265
// sends the contents of the file at HEAD with a URI that starts
266266
// with 'inmemory'. Untitled files which have been marked of
267-
// type PowerShell have a path starting with 'untitled'.
267+
// type PowerShell have a path starting with 'untitled'. Files
268+
// opened from the find/replace view will be prefixed with
269+
// 'private'.
268270
return
269271
filePath.StartsWith("inmemory") ||
270-
filePath.StartsWith("untitled");
272+
filePath.StartsWith("untitled") ||
273+
filePath.StartsWith("private");
271274
}
272275

273276
private string GetBaseFilePath(string filePath)

0 commit comments

Comments
 (0)