Skip to content

Type completion doesn't work when using "Using namespace" statements #3940

Closed
@MartinGC94

Description

@MartinGC94

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all 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

using namespace System
[System.Object<Ctrl+Space>

The above scenario doesn't work.
If you remove the using statement or point it to something else like System.Management it works like you would expect.
I'm guessing the completion code doesn't handle the namespace text removal properly.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.0-preview.3
PSEdition                      Core
GitCommitId                    7.3.0-preview.3
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.67.0-insider
ab86e0229d6b4d0cb49cfd6747c92cafcd2bd4af
x64

Extension Version

ms-vscode.powershell-preview@2022.4.2

Steps to Reproduce

1: Type in the following:

using namespace System
[System.Object

2: Try to complete the type

Visuals

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions