PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.7k stars 488 forks source link

.net intellisense break in workspaces #2157

Open itfranck opened 5 years ago

itfranck commented 5 years ago

Issue Type: Bug

This happens whenever I have anything loaded in Powershell with more than a few files.

Whenever I start VsCode and / or kill my session, there is a moment where the .net intelisense work normally.

image

However, a mere second after, anything from the .net space disappear and I only get the Powershell intellisense instead.

image

If using VsCode with a single file, it works fine. As soon as I open a folder containing dozens of Powershell files (within or without a workspace), it work briefly as the session load, then break.

To reproduce:

  1. Clone https://github.com/itfranck/DudDashboard
  2. Start VSCode
  3. Open a ps1 file
  4. Type [System. then press space

For a few seconds, Collections / Threading / Net and other .Net namespace will be available. If you repeat the operation a few time, the .Net namespaces stop being suggested and only Powershell suggestions occurs.

This happened for a few months with both Powershell and Powershell Preview extension and with both VsCode and VsCode insiders.

Here are the logs : logs.zip Context :

If there's any addtional logs I can include to provide more insight, I will be happy to.

Extension version: 2019.5.0 VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z) OS version: Windows_NT x64 10.0.17763

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz (8 x 3500)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.89GB (18.23GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
rjmholt commented 5 years ago

Thanks for opening an issue @itfranck. This is something I've experienced before, but it's not clear why this happens.

Would you be able to set the log level to Diagnostic and provide us with the logs? That way we'll have more information to work with.

Are you experiencing a loss of all intellisense or just .NET intellisense?

We're currently reworking the PowerShell extension with an eye to improving performance and robustness. So while we may not be able to service this bug immediately, I suspect it's something you'll see improvement with in the medium term.

itfranck commented 5 years ago

@rjmholt

I attached the logs specified the context in the first message. I confirm that the loss I do experience is only .NET intellisense

I also put up a VM to get a completely new environment and the issue didn't seems to occurs (but I didn't stick long around )

On my 3 main environments though (Work, PC, old laptop), this "breakage" of .net intelisense do occurs. It seems that an empty workspace (1 file or a few) work but as soon as I open bigger workspaces, I do loose all .net auto-completion.

itfranck commented 5 years ago

I'm all good with Medium term ETA :) That would be awesome to get that bit working consistently. In the meantime, I keep vscode insider or ISE open when I want to get my .net intellisense and copy / paste over. Not ideal, but I'd never go back to ISE

Also, an additional mention worth to mention. Although .net intellisense is broken, it does enumerate static method properly.

For instance, it won't give me anything for [string (or any shorter part of it) but if I complete it and add the 2 semi column, it does provide the methods.

image

image

SydneyhSmith commented 5 years ago

@itfranck thanks for providing this information...one more question have you seen this same behavior in the PowerShell (not Preview) Extension?

itfranck commented 5 years ago

@SydneyhSmith

Yes, I do experience the same behavior.

This is an issue that occurred for at least a few months, during which I tried all mixes I could think of. VSCode + Powershell only (no other extensions)

VSCode + Powershell VSCode + Powershell Preview VSCode Insiders + Powershell VSCode Insiders + Powershell preview.

I do have the same behavior on all environments.

The one thing I seem to notice is that if I open something lite like a singular file or a small workspace, it seems to work.

For instance, a script divided into a few different files (I like to keep everything separated) work fine. When I load a bigger project containing a bigger amount of files, then it breaks (although as mentionned in my previous post, the .net intellisense work partially.

SydneyhSmith commented 4 years ago

@itfranck we recently published an update to our extension which has addressed a number of underlying architectural issues, would you mind giving it a try and letting us know if you are still hitting this issue?

itfranck commented 4 years ago

@SydneyhSmith

Does the VSCode version matter or only the Powershell extension does ? Is it fixed in both Powershell / Powershell Preview or only Preview ?

(I assume only the Powershell version should matter but...)

I did some preliminary testing using

VSCode Insiders did not have the issue. VSCode standard did not work at all.

I will perform additional testing this week on all my environments (including a brand new without any other addons in the way) and report this Friday.