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.

PowerShell tab completion doesn't work for Write cmdlets when variable is in quotes

See original GitHub issue

From @powershellpr0mpt on June 15, 2017 12:47

  • VSCode Version: Code 1.13.1 (379d2efb5539b09112c793d3d9a413017d736f89, 2017-06-14T18:21:47.485Z)
  • OS Version: Windows_NT ia32 10.0.15063
  • Extensions:
Extension Author Version
PowerShell ms-vscode 1.3.2

Steps to Reproduce:

  1. Create a variable with
  2. Type any of the PowerShell Write-cmdlets [Write-Output/Host/Warning/Error] and open quotes "
  3. Type $ to reference a variable and try tab completion.

Expected behaviour is VSCode simply providing a list of available variable, similar to when no quotes are used.

See attached .gif for easily reproduced example vscode_write_variable

Reproduction Code:

$test = 1
Write-Output "$t

and try tab completing the variable

Copied from original issue: Microsoft/vscode#28814

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mattmcnabbcommented, Jun 15, 2017

Another way of saying it: Intellisense is not automatically invoked inside quotes - you have to manually invoke it.

1reaction
mattmcnabbcommented, Jun 15, 2017

Wanted to point out that this doesn’t appear to be an issue with the Write-* cmdlets, but simply the way intellisense works in the editor when a variable is inside double-quotes. For instance, you can repro this with Get-Process just like above.

I’ve always noticed this but simply chalked it up to the Intellisense behavior and learned to use Ctrl+Space to complete values inside quotes. It works just fine in the Integrated Terminal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Powershell 7.3.0 Tab completion not working - Stack Overflow
The problem is that when I press Tab it doesn't complete the command, instead it just starts listing current directories, i.e. here is...
Read more >
About tab expansion - PowerShell | Microsoft Learn
File and cmdlet name completion. To fill in a filename or path from the available choices automatically, type part of the name and...
Read more >
Using tab-completion in the shell - PowerShell | Microsoft Learn
Tab completion resolves variable assignments that are enums or are type constrained · Tab completion expands abbreviated cmdlets and functions.
Read more >
Register-ArgumentCompleter (Microsoft.PowerShell.Core)
The Register-ArgumentCompleter cmdlet registers a custom argument completer. An argument completer allows you to provide dynamic tab completion, at run time ...
Read more >
Set-Content (Microsoft.PowerShell.Management)
Set-Content is a string-processing cmdlet that writes new content or replaces the ... Value parameter on the command line or send content through...
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