Typescript & Javascript language features extension in VSCode causes my laptop to overheat - visual-studio-code

It's been like a month since I started using VSCode and I like it.
However, The problem is the moment I launch the program the laptop's fans start to make relatively loud sounds so I thought because there were multiple programs running at once but after trying to launch VSCode alone the problem remains untacked.
Here's what I've tried so far:
Disabled the gpu accelartion.
Disabled all the built-in extensions except the Typescript & Javascript language features extension (I didn't install any additional extensions)
Tried clean install.
Nothing worked, But when I tried to disable Typescript & Javascript language features extension the fans started to cool down. I even checked the system monitor. The reading of CPU usage for VSCode before and after disabling the mentioned extension
It jumped from 0% to 28% to 30% to 16% and keeps bouncing between 9% and 16% for as long as the application is running.
I know it seems obvious to disable this extension and I'm good to go but I need it, I mean the whole point of me using VSCode is this extension. Did anyone run into the same problem or it's only me?
P.S: I'm using Ubuntu 18.04 LTS.

So after decades of research this guy's answer solved the problem.
All you have to do is to open VSCode then File > Preferences > Settings then type the following in the search bar typescript.disableAutomaticTypeAcquisition then check the checkbox and you're good to go.
However, autocomplete is not working for some imported packages so be aware of that.
Anyway, I opened an issue long time ago if anyone wants to follow any new updates about this topic here.
Go and give this guy's answer a thumbs up or love because he deserves it.

Related

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!

How to investigate VS Code taking 30% of CPU although it is supposed to do nothing

My CPU is oscillating between 20 and 30% usage for CPU usage based on Windows Task manager. it is occurring for several hours now.
I expect this VS Code instance to do nothing.
How can I investigate what is going wrong?
I tried to open "Developer: Toggle Developer Tools", then go to performance tab and record. Unfortunately it is reporting that most of the time is in "idle" (which is what I would expect)
(I also tried to ask on Twitter without success https://twitter.com/apupier/status/1100348567926071296)
regards,
Based on the comments it seems that what the Task Manager reports is the total use of VS both on CPU utilization and memory.
A broad range of reasons could explain the observations you made.
1.Increased CPU and Memory usage by VS Studio.
2. Increased Fan Speed.
3. Your code being idle.
It can be the case that the VS Code or one of its plugins is actually doing something even if you do not actively use it. For sure if it is opened, even without being used the program will use some memory.
You can find more information on the CPU usage per VS Code Extension by typing: code --status in the command line. You can also try to execute: code --disable-extensions to run VS Code without any extensions to see if the CPU/Memory usage is reduced.
Results of the code --status will look like this
There are some related issues you could also see in GitHub, I checked before writing this answer:
100% core CPU usage without apparent reason
Excess CPU usage
Excess CPU usage editing C file
It is usually an extension. E.g. Python Intellisense. It is perhaps outsourcing processing for some scientific project aimed for the good of humanity. Fingers crossed.
Update 2022:
Earlier you could find them easily with VS Codes builtin Process Explorer. Help > "Open Process Explorer."
But the newer versions are very sneaky. They seem to have evolved making them difficult to catch while stealing your cpu. Disclaimer: the behavior may very well be even an unintentional glitch although it does not appear so.
Can you catch it in action?
Its as tough as catching a fly. As of Feb 2022, the moment you attempt to probe into the cpu usage either via vs code "help/Open Process Explorer" OR sometimes even win task manager, it stops/vanishes like a fly. Then it stays inactive for some hours or a day. You forget about it and get busy coding only to find the fans are going crazy because it has sneaked in to be active again. The newer version of the bug is perhaps programmed as such.
None the less with a lot of patience, you can sometimes catch them. Here is one instance and yet it vanished before i could scroll to catch the name.
VS Code Process manager
Solution:
I don't have a reason to probe it beyond a limit, but a small monitoring script should be able to catch the culprit.
Personally, I just had to remove the "Python extension for Visual Studio Code (Python IntelliSense - Pylance)" and that was enough to resolve.
IDE's a notoriously expensive to run. As soon as you open VS Code it loads the program from your hard drive, into RAM; acting as a staging point for all the processes VS Code uses to manage its environment. Things like,
Overhead of the Electron framework upon which it is built
Checking for external file changes that need to be synchronized to the editor
Render pipeline
Child processes to support any extensions you have running
Terminal instances (and by extension anything running in those terminals)
Here's a nifty little extension I found after some quick Googling. It will show you the subprocesses running in VS Code, and may help you identify exactly what is taking up the most bandwidth. Do keep in mind, that by killing some of those processes, you may begin to lose the associated functionality, and indeed possibly even cause VS Code to crash. The only sure-fire way to keep it from taxing your CPU, is to shut it down completely when you're not using it.
Perhaps you could try out another IDE like Sublime, IntelliJ, or Atom and see if they act more as you expect when idle. Personally, I really love the features of Jetbrain's IntelliJ (and similar: Webstorm, PhpStorm, etc).
I got the same problem. It might have something to do with the git operations. You might have DELETED many projects from your current folder, while git didn't register the deletion.
When you do something with the changes, git operations will use a lot of CPU.
The simplest solution is to create a new folder and start running VSCode in it. You can delete the whole old folder, or you can leave it alone. It's up to you.

Why does VS Code require so much memory? How can I make it run more memory-efficiently?

Does anyone know how to make VS Code use less memory?
It´s taking more than 2gb, sometimes more than 3 gigabytes to have some 8 files opened.
I'm on the VS code team.
There are many possible causes for high memory usage. We've put together tools and a guide that can help you investigate potential performance issues.
Start by using the process explorer. The process explorer shows the cpu and memory usage per child process of VS Code. Open it with the Open process explorer command. The process explorer should help you track down which processes are using the most memory. Often times, an extension will turn out to be the root cause
Also, even though you have only opened eight files, your workspace seems to be quite a bit larger than just those eight. Providing intellisense and other advanced editor features often requires processing many unopened files as well. Whether or not the 2-3gb is justified or not is hard to say without understanding what extensions you are using and what your workspace contains.
I recommend that you also take a look through the rest of our performance issue guide. It explains how to report performance issues and further investigate performance problems.
You could prevent vscode from watching folders with really many files in you project by adding this to your json settings file
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/node_modules/**": true
}
It's because VS Code isn't a native program like Vim, Emacs, or even Sublime. Opening VS Code is like opening another Chrome window, it uses a lot of RAM, and CPU.
Neovim uses around 10 mbs of RAM (with some plugins), while vs code uses 700 mbs of RAM, with no file opened
Because VSCode is built on top of Electron, so under the hood it is just the same as web browser.
If you need more lighter memory use Sublime Text or Notepad++ instead
Check if your extensions are causing the bad things
I have used the guide https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-the-running-extensions
to know why VS Code was
very slow to startup
taking much ram (3-4 gb)
You can create a CPU profile and share it in the issue with the extension author or us. To create a CPU profile:
Close all instances of VSCode and start with code --inspect-extensions=9993 or any other port number.
Execute the Developer: Show Running Extensions Command. This command opens an editor with all the running extensions. To start recording a profile
I found some extension with high delays and they were marked with unresponsive yellow triangle. I disabled them using right click context menu, restarted VS Code, and after that it
Takes only a few seconds to startup
Takes only ~250mb of ram
Not an actual solution, but launching VSC via code ./ --disable-extensionscan do so without requiring to manually disable all of them.

My Visual studio 2013 typing and scrolling is slow. What Can i do?

I'm Currently working on Visual studio 2013 (MVC 5). Since few days I'm getting a problem with typing and scrolling, database is connecting slow. But all working fine but slowly.
Problems:
When typing a letter that keyword display taking long time and some
times not displayed.
Scrolling the solution explorer does not response correctly.
Connect the Database is not showing the connection string.
I searched on the internet and found smooth scroll plugin. After installing that it worked for some hours only after that getting same problem
Apart from Visual Studio 2013 Update 5 which will play an important role here you can also check other solutions listed below.
For smooth scrolling you could try the below steps :
For smooth scrolling install this extension
In VS Go Tools > Environment > General.
My Install had the "Automatically adjust visual experience based on client performance" checked which was using software-accelerated rendering. I unchecked this and checked "Use hardware graphics acceleration if available".
Restart VS
Slow building, debugging, navigating ?
Why is VS 2013 very slow?
More references :
MSDN
You need to check two things: CPU load and drive load. Open the Task Manager and observe the CPU load to determine if the problem is due to the CPU is being overloaded. Watch the HDD LED to see if it flashing rapidly or on and solid to see if the problem is due to the hard-drive is being thrashed (and thus overloaded). Both can cause this symptom. If you find either to be the case, then your next step is to figure out why the system is being burdened.
if 0% CPU and 0% disk. But any text editing heavily lags? Must be due to some sort of plugin or something. I know the CodeLens, Insights, and Microsoft Git have had issues reported with slow IDE response.
Also try disabling Synchronized Settings in VS. Go to Tools -> Options -> Environment-Synchronized Settings and remove this option by un-checking the check box.
Update your Visual Studio get working normally.
https://www.visualstudio.com/en-us/news/vs2013-update5-vs.aspx

VSCode plugins and thoughts on alpha release

So I'm starting to guess Javascript wasn't the best choice for VSCode to be based on. It is pretty much the same as SublimeText and even slower, though the debugger and code intel is awesome and far beyond Sublime's capabilities.
The thing is I suddenly got a chrome-like inspector frame on the right side of the window, which caught my attention and got me googling about it (too bad almost nobody is talking about vscode yet so it's a pain to even find some info), and found out another person got the same weird issue. Somebody told him that F12 opens the inspector like a normal web app so you can look under the hood (which os most likely bullcrap since it makes no sense, probably just a bug).
The thing is I decided to test out keypresses, and discovered Fn+Shift+Cmd+F12 opens a new window with a weird button and a web inspector, which has no utility at all, but it's there so I got curious and messed up with it for a while. Bad idea since it crashed the entire app.
All this story has the point of warning about how Javascript is not as stable and independent as Objective C, since it's obviously working on top of V8 and Webkit and whatnot, any of which multiply its chances to crash.
Sublime has also crashed for me a couple times, but it does Atom Saving (operating system's native autosave that stores every change in the filesystem so app crashes don't affect the files).
VSCode is not native and is in a very alpa state (version 0.1.0 as today), so this is kind of a feedback for them and a warning for other users, posted here because there is a link for this stackoverflow community on their website, and is the only community-driven way of feedback they have.
I wish they open the development so others can contribute or, at least, do like SublimeText which isn't open but supports extensibility thru plugins and python console.
Now, the question:
Is there a way to make Sublime plugins work here?
The keybindings you have found are used by us internally to debug VSCode quickly in case we notice a problem. We simply forgot to remove them, kind of like how Ctrl+Alt+Delete happened :).
We will remove these keybindings with our next update, to avoid confusion, in a couple of weeks.
We have plans on supporting plugins, we have made progress on this story, but we were not happy enough with the API, and we decided to further validate and improve it before making it public, to avoid as much as possible future API breakage.
As for the actual question, it is not possible to run Sublime plugins in VSCode, for similar reasons why it is not possible to run Sublime plugins in Eclipse or in Visual Studio. There is, however the possibility of code sharing between plugins developed for different platforms, see for example Omnisharp, which is shipped with VSCode and for which there is a Sublime plugin.
You're complaining about VSCode being created using HTML, CSS and JavaScript and not something like C# or Objective C. You do realize that since day one the following Apple apps were made with a similar hybrid approach of Objective C and HTML, CSS and JavaScript. These are apps that millions of people use: iOS: iTunes app, iTunes Store app, App Store, and on desktop: iTunes, App Store.
Visual Studio Code is a preview, meaning something that just left alpha stage development and is in early, early, early beta, like just a week ago. So there are lots of things that are still missing or not totally working yet. The Visual Studio team is working at three-week sprints and intend to update the product at that pace, so if you've downloaded it, don't expect it to have every possible feature yet. This is a preview. Explore it. If it doesn't fit your current workflow, don't use it. Stick with what you have. But keep an eye on it because it will evolve steadily over the coming months.
I tried F12 in VSCode on windows and it opened the Dev Tools window, which makes sense since it's built on GIT's open source editor Atom & Chrome.
Sublime plugins? No, you can't use ST3 plugins in Atom, but hopefully we'll be able to use Atom plugins in VSCode once plugins are included in VSCode.
At the moment VSCode don't have any functionality for plugins, but it's coming soon see forum
There is also menu item under help in VSCode for reporting issues and suggesting features.
Me too would like Plugins for VS Code. As I would like a WakaTime plugin as I'm spending so much time working in it :). Both on Mac as in Windows.
I also discovered F12 one day but just thought: 'wow pretty cool!' and nothing more. But hey, I'm a webdev.. :)
It's now october and it's still there. And I hope it will stay. Just like crrl+alt+delete. #Sebastian I agree with #JimmyBoh, the whole preamble of this question is probably better suited to be put on a forum. Otherwise this question will probably be closed as 'not constructive'. To prevent other non-answers like this one :).