Closed cdelcambre closed 4 years ago
@cdelcambre thanks for opening this issue, and providing repro steps! I want to ensure that I understand what intellisense you are looking for/expecting, because I am having some trouble reproducing the issue
It would be great if you could attach a gif/screenshot or a description of what intellisense you are looking for--thanks!
Thank you for looking into this @SydneyhSmith! Your screen shots are exactly what I am hoping for but I don't get what you get on the function functAutoSenseBroke. For both I get a long list of nonsense parameter name suggestions I could definitely live without. Typing the text of the parameter I am looking for narrows down the noise. Perhaps that's a symptom of my problem because I don't see that long list of noise suggestions in your screen shots. Maybe I have a config issue? This is a clean install done today of both VS code and PowerShell extension. All default settings.
Noise!
Extension Details
VS Code Details: Version: 1.40.1 (user setup) Commit: 8795a9889db74563ddd43eb0a897a2384129a619 Date: 2019-11-13T16:49:35.976Z Electron: 6.1.2 Chrome: 76.0.3809.146 Node.js: 12.4.0 V8: 7.6.303.31-electron.0 OS: Windows_NT x64 10.0.18362
I reported a similar issue in #2117 . For arguments sake I tried your example and have the same issue, there simply is no argument or parameter completion on the function Get-Stuff
.
Enum AzureSqlEdition {
Standard
Premium
Basic
}
Function Get-Stuff {
[CmdLetBinding()]
Param (
[Parameter(Mandatory)]
[AzureSqlEdition]$DbType,
[Parameter(Mandatory)]
[string]$OtherParameter
)
$PSBoundParameters
}
The completion is simply not done in the editor pane when typing partially -db
to get the full parameter name -DbType
. Even thought the suggestion on top says it is known:
But in the vscode-insiders
console, after several tries, the completion is done correctly:
In the PowerShell ISE
there is no problem when typing in the console pane:
But the same problem is happening when typing in the PowerShell ISE
editor pane, no completion whatsoever:
This is happening on vscode-insiders
with PowerShell Preview
extension 2019.11.0
:
Version: 1.41.0-insider (user setup)
Commit: 29b99f85e54aa5af6cd4edf918a67d4f70a10aea
Date: 2019-11-19T10:22:48.048Z
Electron: 6.1.4
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 6.2.9200
Yeah completion acts differently when the source is also in the text it's trying to complete for. If you:
Then it'll probably act same. A very similar issue is PowerShell/PowerShell#10567. This is something that needs to be corrected in PowerShell itself (the engine provides the API that does all of vscode-powershell's completions)
Closing as an external fix in PowerShell https://github.com/PowerShell/PowerShell/issues/12079
VSCode Version: 1.40.1 OS Version: Windows 10, 1903 Powershell Extension: 2019.11.0
Steps to Reproduce:
Create an Enum Create a function which references that Enum as a parameter. Call that function, there will be no autosense when populating the parameters and values for said function.
Simple Example