Skip to content

Support unloaded enums and classes in Intellisense #2312

@cdelcambre

Description

@cdelcambre

VSCode Version: 1.40.1
OS Version: Windows 10, 1903
Powershell Extension: 2019.11.0

Steps to Reproduce:

Create an Enum
Create a function which references that Enum as a parameter.
Call that function, there will be no autosense when populating the parameters and values for said function.

Simple Example

Enum AzureSqlEdition
{
Standard
Premium
Basic
}

function functAutoSenseBroke
{
param
(
[Parameter(Mandatory=$True)][AzureSqlEdition]$DbType,
[Parameter(Mandatory=$True)][string]$OtherParameter
)
Write-Host $DbType
Write-Host $OtherParameter
}

function functAutoSenseWorks
{
param ( [Parameter(Mandatory=$True)][string]$DbType )
Write-Host $DbType
}
#works but no autosense
functAutoSenseBroke -DbType ([AzureSqlEdition]::Standard) -OtherParameter "other"

#Simple Function, no Enum, autosense works, for comparison purposes
functAutoSenseWorks -DbType "test"

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