You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I put [ArgumentCompleter([MyType])] on a [string] parameter. Code is trying to treat the attribute as the type. Types don't have parantheses. But otherwise, the syntax for an attribute reference is similar to how you reference a type. Though, in this case, an attribute type reference would be [ArgumentCompleterAttribute]. I tried it with both a class passed to the attribute and a script block. Same results both times.
On a related note, when I try to run my script outside Code in Windows Terminal, PS 7.3.4 ignores the same [ArgumentCompleter()] attribute references. It acts as those attributes aren't there at all.
PowerShell Version
PS C:\Users\willp> $PSVersionTableName Value---- -----PSVersion 7.3.4PSEdition CoreGitCommitId 7.3.4OS Microsoft Windows 10.0.22621Platform Win32NTPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1WSManStackVersion 3.0
Prerequisites
Summary
I put
[ArgumentCompleter([MyType])]
on a[string]
parameter. Code is trying to treat the attribute as the type. Types don't have parantheses. But otherwise, the syntax for an attribute reference is similar to how you reference a type. Though, in this case, an attribute type reference would be[ArgumentCompleterAttribute]
. I tried it with both a class passed to the attribute and a script block. Same results both times.On a related note, when I try to run my script outside Code in Windows Terminal, PS 7.3.4 ignores the same
[ArgumentCompleter()]
attribute references. It acts as those attributes aren't there at all.PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
I wrote the argument completer class shown below.
I then applied that attribute to my method's parameter. (Simplified version of the method shown below.)
Visuals
This screenshot shows how such code is rendered. Notice how the
ArgumentCompleter
attribute is in blue. It should be in a brown.Logs
No response
The text was updated successfully, but these errors were encountered: