visual-studio-code - VSC 无法监视这个大工作区中的文件更改,很奇怪

标签 visual-studio-code

我刚刚开始使用 VSCode 版本 1.24.1。

加载文件夹后,显示警告

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

在我检查了他们 guide 上建议的限制后,使用

cat /proc/sys/fs/inotify/max_user_watches

我得到 8192,而我的项目只有 650 个文件(其中 400 个位于 .git 内)

为什么会发生这种情况?这是一个错误还是我遗漏了什么?

(增加限制显然不是正确的解决方案。)

最佳答案

linux ppl 不知道什么,有像我一样刚接触 Linux 的人。因此,如果您是菜鸟,那么这就是为您准备的。

  1. 打开一个新terminal .
  2. cat /proc/sys/fs/inotify/max_user_watches (可能是 8k+ 的数字)

现在(a)对于 vim -编辑器

  • (a) sudo vim /etc/sysctl.conf
  • (a) 一直向下并添加一个新行:fs.inotify.max_user_watches=524288 (确保命令前面不要#)
  • (a) 类型 :wq!然后按输入
  • (b)对于 nano -编辑器(感谢@bradrar)

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

  • (b) 一直向下并添加一个新行:fs.inotify.max_user_watches=524288 (确保命令前面不要#)

  • (b) 输入 ctrl + x,输入 y 并按 enter
  • <小时/>
  • 类型 sudo sysctl -p
  • 再次输入:cat /proc/sys/fs/inotify/max_user_watches (现在应该是50万+)
  • (稍后谢谢我。)
  • 关于visual-studio-code - VSC 无法监视这个大工作区中的文件更改,很奇怪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50901127/

    相关文章:

    visual-studio-code - 如何在 VS Code 中自动缩进嵌套的 HTML 标签

    visual-studio-code - 在 VSCode 扩展中检测 Debug模式

    bash - VS Code - wsl 服务器意外关闭

    javascript - vscode Intellisense NodeJs

    visual-studio-code - 是否可以将参数传递给 Visual Studio Code 中的任务

    git - 有没有办法指示 Visual Studio Code 跳过 git commit 钩子(Hook)(即提供 -n 参数)?

    gulp - 有没有办法在 VSCode 中刷新任务列表?

    python - VSCode 折叠文档字符串 Python MacOS

    java - 无法在 Java 中的 VS Code 本地运行中命中 azure 函数

    visual-studio-code - 如何在 VS Code 中查找文件夹?