Skip to content

Instantly share code, notes, and snippets.

@Roxbili
Last active March 7, 2023 07:41
Show Gist options
  • Save Roxbili/471383df95c0e244ef3a8a21f6c90f10 to your computer and use it in GitHub Desktop.
Save Roxbili/471383df95c0e244ef3a8a21f6c90f10 to your computer and use it in GitHub Desktop.
VS Code: Unable to watch for file changes in this large workspace folder. Please follow the instructions link to resolve this issue.

Docker用户

Docker这部分设置是继承主机的,因此以下流程需要在host侧去执行(需要管理员权限的,放弃吧!)

参考链接:coder/code-server#628

非Docker用户

由于linux系统允许用户监控文件的数量是有限制的,所以导致vscode无法监控文件数量很多的代码库,因此需要单独设置一下。

参考链接:https://stackoverflow.com/questions/50901127/vsc-unable-to-watch-for-file-changes-in-this-large-workspace-weird

下面是相关回答:

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+)
  3. sudo vim /etc/sysctl.conf
  4. 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)
  5. type :wq! and press enter
  6. type sudo sysctl -p
  7. type again: cat /proc/sys/fs/inotify/max_user_watches (should be 500k+ now)
  8. (thank me later.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment