Visual Studio Code - Powershell - High CPU and Slow performance switching between Powershell files - powershell

I have a fresh installation of Visual Studio Code 1.16.1
I have the following extensions:
Chef Extension for Visual Studio Code 0.6.3
Code Outline 0.0.10
Powershell 1.4.3
Ruby 0.15.0
I try to edit Powershell within VSCode.
Powershell is loaded (Version 5.1)
But every time I switch between one of my open files (In the current test case, an psm1 and psd1) I see a little loading bar at the top of the Explorer sidebar, just below the Explorer text.
While that's going, I can't "Run Selection", Code Outline does not update nor do I have any form of syntax-assistance while writing code UNTIL it is done. Then all of the items you tried to do, happen all at once.
Until I switch windows, everything works as expected. The moment I switch files, it starts "loading/working" again and I have to wait about 30 seconds for it to do it's thing.
I have also tried disabling all extensions (except Powershell) and I see nearly the same behavior. When switching tabs, the loading happens but I don't see the loading bar in the explorer sidebar described above.
I currently do not have a different machine to test this on, working on getting a second machine to rule out the computer.
I am looking into logging a bug but before I do, I wanted to check here.

Related

PowerShell 5.1 in Visual Studio code behaves strangly

When using PowerShell in VS code and working interactivly, often when I highlight some code and run it then it does not print anything in the terminal. Then I simply restart The "PowerShell Integrated Console" (by pushing the trash can) and it then works again.
It is quite annoying. My ADS also acts like this. Is this a general problem with PowerShell with VS Code or is it my computer?
My VS Code version is 1.68.0. My PowerShell version is 5.1.19041.1682. And the version of the PowerShell extension is v2022.5.1

Visual Studio code : Issue loading Extensions

I am using visual studio code to do my LWC change and it takes at lest 5 minutes to load those extensions. Some times it fails outright and would not let me run commends.
Is there an option to force run extensions?
There is no option to force run extensions in VSCode. It is likely that your hardware and system configuration is not capable of running your program quickly. Consider editing your question to include your computer specs.
While IntelliJ IDEA does require better hardware than VSCode, consider trying that IDE for LWC instead in case it is a VSCode issue and not your hardware.

Watch is not working in VSCode, howto fix?

Some time ago a Watch window stop working in Visual Studio Code. I am using VsCode for Powershell only. Powershell is only one extension that is installed. However, I can see variables in Variables->Auto and when I put the mouse cursor on the variable. Windows with all updates and VScode is the latest version. Pressing "+" in the watch window sometimes allows adding variables sometimes not, but in all cases, the value is empty.
P.S. Start VCsode with local admin rights didn't help.

How can I get Visual Studio Code to reset the IntelliSense engine for Rust?

I am working on two projects, one is a library, the other is a program that uses that library. When I make changes to the library the other window (the program) doesn't see these changes, so I do not get updated IntelliSense. Closing the program that uses the library and reopening it does force an update but I really prefer not having to go that far.
Answering the title directly and not the root issue...
You can reset IntelliSense and all Rust code features by running the "Rust: Restart the Rust server" command from the command palette (Ctrl+Shift+P).
Progress will be indicated in the status bar.
Still a blunt tool but it will ensure you're in a fresh state without having to restart VS Code entirely.

How do I prevent Visual Studio Code from opening with previously-opened files?

I've noticed that, despite always closing it before I quit, despite opening other files as well, Visual Studio Code will always re-open a particular file when I launch the app. This is still the case after upgrading to the latest version - 0.7.0 at the time of writing.
Is there a setting I'm missing, or something that needs to be cleared out / blown away?
I'm running on Windows Server 2012 R2.
This issue has been fixed for the next release and only shows up when you work in file mode and not folder mode (that is when you are not actually opening a full folder inside VS Code).
To workaround this, use the -n option when you run VS Code. -n will force to open VS Code empty without any file or folder opened.