Skip to content

Completions don't work in a completely empty script file #4909

Open
@MartinGC94

Description

@MartinGC94

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

In this PR: PowerShell/PowerShell#21171 I've added the ability to complete keywords without having to write a partial name, this works great except when the file is completely empty in VS code. The console host and even ISE handles completely empty input without any problems.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.5.0-preview.1
PSEdition                      Core
GitCommitId                    7.5.0-preview.1-9-g0ecf5c46ddc68356ae8ef8be2bb0655b8a43023c
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2024.0.0
InstanceId       : 17ccb628-ca60-4f48-8f98-1d70a9d57022
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : da-DK
CurrentUICulture : da-DK
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.86.0-insider
5d344004f839677def958534b58e854a9ae26fd0
x64

Extension Version

ms-vscode.powershell@2024.0.0

Steps to Reproduce

  1. Download a build from the branch
  2. Launch the pwsh executable and check the PID $pid
  3. From VS code, type in Enter-PSHostProcess <PID from before>
  4. Press Ctrl+Space in an empty file

Visuals

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions