question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intellisense not working when more than one DynamicParameter is used

See original GitHub issue

Version: 1.37.0-insider (user setup) Commit: 92da68a71cfb60bd3b9b0d7fbfb2a7e1fff9dbaf Date: 2019-08-01T05:37:54.848Z Electron: 4.2.7 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 6.2.9200

Steps to Reproduce:

Consider the following example function:

Function Test-Stuff {
    Param (
        [Parameter(Mandatory, ValueFromPipeline)]
        [Object[]]$Ticket,
        [Switch]$PassThru
    )
    DynamicParam {
        $DynamicParameters = @(
            @{
                Name        = 'Environment'
                Type        = [Array]
                Position    = 0
                Mandatory   = $true
                ValidateSet = @('Test', 'Prod', 'Stage', 'Dev')
            }
            ,
            @{
                Name        = 'Type'
                Type        = [Array]
                Position    = 0
                Mandatory   = $true
                ValidateSet = @('Incident', 'Request', 'Project')
            }
        )
        $DynamicParameters | ForEach-Object { New-Object PSObject -Property $_ } | New-DynamicParameter
    }
    Begin {
        New-DynamicParameter -CreateVariables -BoundParameters $PSBoundParameters
    }
    Process {
        'yes'
    }
}

The function `New-DynamicParamter’ can be downloaded here.

  • When using intellisense in the editor pane it keeps on loading and nothing is suggested for the second/last dynamic parameter (in this example -Type)

image

  • Observe that the same function with intellisense works fine in the Terminal or in the editor of the PowerShell ISE.

image

I was going nuts about this, because I thought my code was broken. Seems after a bit of stressing it’s a bug in the editor pane. Thank you for looking at this.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rjmholtcommented, Aug 8, 2019

@DarkLite1 based on your response, I suspect you’re hitting https://github.com/PowerShell/PowerShellEditorServices/issues/762#issuecomment-428756484. @SeeminglyScience might have some insight there.

This is something we don’t have much control over; the fix lies in PackageManagement, but we’re investigating how to fix it since it also affects PSScriptAnalyzer

0reactions
TylerLeonhardtcommented, Aug 15, 2019

Bot is trigger happy…

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# intellisense incorrect for method that takes a dynamic ...
I can't use intellisense any more on b until I do a dummy recast (int)SomeType.Fn(value) for what was already prototype to return an...
Read more >
IntelliSense in Visual Studio Code
IntelliSense. IntelliSense is a general term for various code editing features including: code completion, parameter info, quick info, and member lists.
Read more >
Identify issues with IntelliSense (SSMS) - SQL Server
Parameter help does not support the parameters in some objects, such as extended stored procedures. For more information, see Transact-SQL ...
Read more >
Dynamic behavior in Svelte: working with variables and props
To prove it, go to that array, and try changing some of the to-do object's completed property values, and even add a new...
Read more >
Place Autocomplete | Places API - Google Developers
Each session can have multiple queries, followed by one place selection. The API key(s) used for each request within a session must belong...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found