Open dfinke opened 8 years ago
Really strange that this only happens after pasting. I'll have to walk through the steps to see what might be different.
If I prime the pump, type get-
, then paste, intellisense works.
Interesting, good data point to have for investigation
Returns 0 matches unless you do get-
first.
I've been looking into this a bit, seems like the ISE gets IntelliSense correctly under the same circumstances. Trying to compare the Editor Services code to it to see what could be different but I haven't found anything conclusive yet.
Yeah, nothing obvious about this. It's definitely frustrating as a user but fixing it, it's a tough one.
Got some insight from Jason about this, it seems the reason why this works in the ISE is because System.Windows.Forms is already loaded in the host by the time you ask for IntelliSense so the completion engine is able to give it to you. That assembly is not loaded by default in PSES so its metadata doesn't get loaded until you type its name in for the parameter of "New-Object". If you paste in the code, the completion engine was never used on the assembly so the PowerShell engine doesn't have any way to get those completions.
I'll put this on the backlog until we decide whether this should be considered "by design" or come up with some other clever solution for it.
Good to know
Hey @dfinke,
I just gave the repro a try in VSCode and was able get intellisense with a ctrl+SPACE
Can you give it another try and see what you find? It's looking like this issue might be fixed.
Paste this into a ps1 file in vs code. I get no intellisense
$form.
.If I retype each line, then
$form.
shows intellisense.