Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSC unable to watch for file changes in this large workspace weird

I just started using VSCode version 1.24.1.

After loading a folder, it shows warning

Visual Studio Code is unable to watch for file changes in this large workspace

After i check the limit as suggested on their guide, using

cat /proc/sys/fs/inotify/max_user_watches 

I get 8192, while my project has only 650 files (of which 400 are inside .git)

Why does this happen? Is this a bug or am I missing something?

(Increasing the limit is clearly not the right solution.)

like image 833
DonJoe Avatar asked Jun 17 '18 22:06

DonJoe


People also ask

How do I fix VS Code error?

Use Quick Actions to fix or refactor code Or, when your cursor is on the line with the colored squiggle, press Ctrl+. or select the light bulb, error light bulb, or screwdriver icon in the margin. You'll see a list of possible fixes or refactorings you can apply to that line of code.

How do I remove pending changes in VS Code?

To undo a few of your pending changes To undo all changes you have made in your solution or a code project, open the context menu, and then choose Undo Pending Change. In the Undo Pending Changes dialog box, make sure the changes you want to undo are selected, and then choose Undo Changes.


1 Answers

what linux ppl dont know, there are ppl new to linux like me. So if you're a noob, this is for you.

  1. Open a new terminal.
  2. cat /proc/sys/fs/inotify/max_user_watches (might be a number 8k+)

now (a) for vim-Editor

  1. (a) sudo vim /etc/sysctl.conf
  2. (a) go all the way down and add a new line with: fs.inotify.max_user_watches=524288 (make sure you DONT have a # in front of the command)
  3. (a) type :wq! and press enter

or (b) for nano-Editor (thanks to @bradrar)

  1. (b) sudo nano /etc/sysctl.conf

  2. (b) go all the way down and add a new line with: fs.inotify.max_user_watches=524288 (make sure you DONT have a # in front of the command)

  3. (b) type ctrl + x, type y and press enter

  1. type sudo sysctl -p
  2. type again: cat /proc/sys/fs/inotify/max_user_watches (should be 500k+ now)
  3. (thank me later.)
like image 180
Andre Elrico Avatar answered Nov 11 '22 18:11

Andre Elrico