[PSS 2015] Extend auto-complete prevention for variables

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
This topic is 8 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2015] Extend auto-complete prevention for variables

Post by Bosparan »

Hi Guys,

recently you updated the autocomplete settings for variables, so that it wouldn't auto-complete for the first variable in foreach ($a in $b) loops (thanks again for this). While I'd still like to be able to exclude all variables from auto-completion, there is one more case where disabling it generally would make sense:

Automatic Variables (especially $_)

Example:
  1. $_Foo = "bar"
  2. Get-ChildItem | Where-Object { $_.Length -gt 1234}
In this case, when trying to write the Where-Object scriptblock, it will erroneously autocomplete $_ to $_Foo.

Cheers,
Fred
This topic is 8 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked