PowerShell tab completion doesn't work for Write cmdlets when variable is in quotes
See original GitHub issueFrom @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:
- Create a variable with
- Type any of the PowerShell Write-cmdlets [Write-Output/Host/Warning/Error] and open quotes "
- 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
Reproduction Code:
$test = 1
Write-Output "$t
and try tab completing the variable
Copied from original issue: Microsoft/vscode#28814
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another way of saying it: Intellisense is not automatically invoked inside quotes - you have to manually invoke it.
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.