PowerShell / PowerShellEditorServices

A common platform for PowerShell development support in any editor or application!
MIT License
622 stars 213 forks source link

Leaky implementation of tab-completion / IntelliSense surfaces phantom variables named for the parameters of the TabExpansion2 function #1969

Closed mklement0 closed 1 year ago

mklement0 commented 1 year ago

Prerequisites

Steps to reproduce

Note:


In an empty .ps1 file open in Visual Studio Code, type the following

$tokens.

Expected behavior

No IntelliSense results, given that $tokens isn't defined.

Actual behavior

IntelliSense results are the [array] type's instance property names, because the -token parameter of TabExpansion2 happens to be array-typed (Token[]])

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Darwin 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

PowerShell Extension v2022.11.0

Visuals

No response