Skip to content

Commit 8a167cb

Browse files
CopilotJustinGrote
andauthored
Fix file-backed checks to use IsUntitled
Agent-Logs-Url: https://github.com/PowerShell/PowerShellEditorServices/sessions/25fb4a4a-04f5-471e-93fa-82a0a9cdcd91 Co-authored-by: JustinGrote <15258962+JustinGrote@users.noreply.github.com>
1 parent 7e2f5d4 commit 8a167cb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/PowerShellEditorServices/Services/TextDocument/Handlers/CompletionHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ private CompletionItem CreateProviderItemCompletion(
366366
if (textToBeReplaced.IndexOf(PSScriptRootVariable, StringComparison.OrdinalIgnoreCase) is int variableIndex and not -1
367367
&& System.IO.Path.GetDirectoryName(scriptFile.FilePath) is string scriptFolder and not ""
368368
&& completionText.IndexOf(scriptFolder, StringComparison.OrdinalIgnoreCase) is int pathIndex and not -1
369-
&& !scriptFile.IsInMemory)
369+
&& !scriptFile.IsUntitled)
370370
{
371371
completionText = completionText
372372
.Remove(pathIndex, scriptFolder.Length)

src/PowerShellEditorServices/Services/Workspace/WorkspaceService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public void CloseFile(ScriptFile scriptFile)
319319
public string GetRelativePath(ScriptFile scriptFile)
320320
{
321321
Uri fileUri = scriptFile.DocumentUri.ToUri();
322-
if (!scriptFile.IsInMemory)
322+
if (!scriptFile.IsUntitled)
323323
{
324324
// Support calculating out-of-workspace relative paths in the common case of a
325325
// single workspace folder. Otherwise try to get the matching folder.

0 commit comments

Comments
 (0)