VS Code freezes on tab change - visual-studio-code

I'm not really a coder but I use VS Code at work for various reasons on my mac.
If I move between VS Code and my browser, every time I open VS code it freezes for a moment. It freezes if I change tab or move file. Looking at my commit changes or doing anything with the in-built terminal doesn't cause it to freeze.
All the dependency packages are up to date. I've disabled all of the plugins and it still happens. VS Code is at the latest version, 1.67.0.
I really don't know what is causing it and would appreciate any help!

Related

Visual Studio Code rebuilds for no good reason

Background:
When the project is already running (npm run start), and I make changes, and save. Then VS Code rebuilds and runs the project. Great!
But it is very frustrating when VS Code is running, and you look through the code (without changing or saving anything), then often VS Code rebuilds for no reason.
When this happens, one loses the DevTools browser inspector, and has to start all over again.
Questions:
So, is there a way to prevent VS Code from automatically rebuilding without having changed or saved anything?
And is it possible to keep the auto-rebuild-on-save functionality at the same time?

Automatic Hot Restart and Reload Stopped Occurring - Flutter/VS Code

I've been learning Dart/Flutter on VS Code and the Hot Restart/Reload was always automatic (if I changed a color in the code, it automatically showed up on screen). I have to manually trigger the action now. I have no idea what changed.
I'm using VS Code and iOS emulator. I can't run SDK on Android Studio right because I'm on the new mac M1 processor.
Solutions I've tried:
Opened other Flutter projects and verified the hot restart isn’t
working on any of them (its not an import error like other posts have suggested)
I ensured that I can manually hot restart from VSCode and terminal to see changes
Flutter Doctor shows no errors
I ran Flutter Upgrade from the terminal anyway
I uninstalled and reinstalled Dart and Flutter from VS Code
I ensured VS Code’s autosave feature was on
I ensured VS Code’s “Dart: Flutter Hot Reload on Save” (and Restart) were both checked
I tried running with and without debugging
I restarted my computer and VS Code
Edit: I just installed Android Studio and cannot get an automatic hot reload here either. I connected it to iOS emulator, turned on automatic saving after 2 seconds of being idle, and still have to manually reload. Alternatively, I can go to the menu and click "Save All" and it will reload to update the UI (without me having to click a hot reload or restart icon). But, it's still manual.
Edit: 2/25/21: A "fix" has been introduced in the v3.20.0 beta.
https://dartcode.org/releases/v3-20/
Ok, I was finally pointed in the right direction for an answer.
Apparently, the automatic hot reload after an IDE autosave was a bug that some users found to be a useful feature. The intended functionality was to only trigger a hot reload on a manual activation. Thus, the bug (feature) was "fixed" taking this functionality away.
Feedback shown a light on the fact that some people found the bug useful and there is now an indication that this functionality will be returned in the future.
https://github.com/Dart-Code/Dart-Code/issues/3110
Edit: 2/25/21: A "fix" has been introduced in the v3.20.0 beta.
https://dartcode.org/releases/v3-20/
VSCode can be buggy sometimes and this problem is arguably the most annoying. I had this happen to me last week when I decided to use a barrel file with flutter web.
Meaning, I had a folder with all the components exported and then would import only that one file, like this
And then wherever I wanted all those files to be, I would add
import barrell.dart
Now this worked perfectly fine when I was working with flutter on mobile, and the second I went to flutter web my app would not hot reload.
I share this with you to say that I found out about this by a process of elimination. Took me a little bit, but I created a new project from the bottom up, added in each part one by one, and then I found that it was this barrell file that was messing the hot-reload up..
So my best advice is to do the same - start fresh with a new project, add back the pieces one-by-one and if you do find out what is causing the hang-up, I implore you to share it here:
https://github.com/flutter/flutter/issues

Unity3D 2020 - VSCode - What happened to intellisense?

Overnight, any help I had for Unity3D in VSCode, i.e. intellisense, disappeared. And I get the sense, no pun intended, that I'm not the only one who's afflicted.
I've tried updating and reinstalling what I assumed VSCode needed to make Unity3D intellisense work. And have checked and re-checked settings, reinstalled VSCode package, in Unity3D.
I've worked through a few tutorials that claimed to address the issue.
What else does VSCode depend on to make this relationship work?
Thanks! Here's to hoping you've fixed this and your life has gotten easier!
Try going to Edit > Preferences > External Tools > Regenerate Project Files (This is because of a bug where the VS Code extension doesn't generate the project files correctly the first time, you can check it out here).
You'll need to be using the VS Code Editor Extension 1.2.0 (you can check which version you're using in the package manager) or later for that option to appear. Also if for whatever reason there are 2 .sln files in your project folder (I've had that happen before, though it's less likely), that also causes problems.
Ok. First, thanks to Lightning_A and Charleh!
The resolution to my specific circumstance was to install the VSCode extension "Unity Snippets Modified" https://github.com/with-heart/vscode-unity-snippets
I had been using https://github.com/kleber-swf/vscode-unity-code-snippets.
Perhaps it's just a matter of Kleber's extension, which is/was great, was broken upon updating Unity to 2020? I dunno and don't have the time to look into it, unfortunately.
Hopefully, my question, the answers I received, and my subsequent resolution saves others from the rabbit-hole I went down.
Again, thanks everyone!

Why are the changes I make to my Rust program from VS Code not reflected when I compile?

I'm having a problem with Rust that I strongly suspect has do with a disconnect between Cargo and VS Code.
I build my Cargo project with cargo new project
I edit my src/main.rs with VS Code and save it.
I issue cargo run
I see the result from the hello world main.rs instead of the results of the changes I made.
What I find interesting is that if I do a cat src/main.rs from the terminal, I see the original Rust code, even though VS Code assures me that it saved it and shows me that code even if I restart VS Code.
I've had this problem on a couple of computers now (same OS, Fedora 28). I strongly suspect that Cargo is doing some buffering somewhere that is defeating VS Code. Has anyone else seen this behavior or know the cause? Are there any cures or work-arounds?
#Tau turned out to be correct. Using Kwrite, the changes seemed to propagate correctly. What's really odd is that Kwrite and VS Code seemed to synchronize with one another. That's really annoying for me as I am a VS Code fanatic. Maybe I post an issue about this for VS Code. Thanks to all for their suggestions.
Make sure autosave is enabled in VSCode.

VS Code - changing tab disables extensions. What am I doing wrong?

Using Visual Studio Code I have installed a few extensions (like Guidelines showing vertical dotted lines between pairs of matching brackets). When I start VS Code I can see all my extensions working fine in the Editor window.
However, when I switch to another tab within VS Code, I no longer see the Guidelines or evidence of any extension working in the new editor tab. Worst of all, when I then switch back to my original tab, all the guidelines etc that were there a few seconds ago are gone!
To fix the issue I have to restart VS Code. This can't be right! Has anyone hit the same problem?
I have tried uninstalling VS Code where it warns me some components could not be uninstalled and I have to do them manually. It doesn't tell me which. When I then reinstall, the extensions are visible (without me reinstalling them) but again I hit the same issues as above.
Please help?
Seems like having too many extensions installed, or perhaps one that is misbehaving behind the scenes, causes this problem. Reduce the number of installed extensions. Use Help->Developer Tools -> Console to see if there are any messages relating to the Extensions server