vscode-powershell: [Preview] Autocomplete doesn't work if parameter type is unknown

Issue Description

I am experiencing a problem with… autocomplete not working some of the time. I was able to pinpoint it to types that are not available for VSCode and it breaks autocomplete totally. In my case ExchangeServiceBase is not there because I am not connected to EWS. But I believe it’s also visible in other cases when types are just not loaded from modules.

This works

function ThisIsMyTest {
    param(
        [string] $Test,
        [string] $Hello
    )
}

ThisIsMyTest

The moment you add another parameter with type that is unknown… whole autocomplete breaks.

function ThisIsMyTest {
    param(
        [string] $Test,
        [string] $Hello,
        [Microsoft.Exchange.WebServices.Data.ExchangeServiceBase] $New
    )
}

ThisIsMyTest

This shows the issue:

AutocompleBroken

VS Code details from original issue

Attached Logs

Follow the instructions in the README about capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.18363
VSCode 1.41.1
PowerShell Extension Version 2019.12.0

PowerShell Information

Name Value
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.18362.145
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
auto-rename-tag formulahendry 0.1.1
beautify HookyQR 1.5.0
bracket-pair-colorizer-2 CoenraadS 0.0.29
code-settings-sync Shan 3.4.3
codesnap adpyke 1.0.26
excel-to-markdown-table csholmq 1.1.0
gistfs vsls-contrib 0.0.23
github-linker gimenete 0.2.3
gitlens eamodio 10.2.0
html-preview-vscode george-alisson 0.2.5
markdown-all-in-one yzhang 2.6.1
markdown-preview-enhanced shd101wyy 0.5.0
markdown-shortcuts mdickin 0.12.0
material-icon-theme PKief 3.9.2
pdf tomoki1207 0.5.1
powershell-preview ms-vscode 2019.12.0
project-manager alefragnani 10.9.1
reg ionutvmi 1.0.1
theme-monokai-pro-vscode monokai 1.1.14
vscode-html-css ecmel 0.2.3
vscode-markdownlint DavidAnson 0.33.0
vscode-pull-request-github GitHub 0.13.0
vscode-wakatime WakaTime 2.2.1
vscode-yaml redhat 0.6.1
xml DotJoshJohnson 2.5.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

You are correct.

  • It doesn’t work in PS5, PS7
  • It doesn’t work in old extension
  • It doesn’t work in new extension

image

I know what you’re going to say 🥴