gitignore 中的大型目录减缓了 VS Code 的速度

huangapple go评论45阅读模式
英文:

Large Directory under gitignore slows down vs code

问题

我有一个存储库,其中有一个名为 data/ 的文件夹,该文件夹也在 .gitignore 文件中,以避免将数据推送到GitHub。该文件夹包含许多巨大的子文件夹。将这些文件包含在我的存储库中会减慢VS Code的"go-to-definition"功能、跟踪更改功能等。有没有办法防止这种情况发生?

我尝试在 settings.json 中将该文件夹包括在观察器排除中,但没有帮助。

英文:

I have a repository in which there is a data/ folder that is also inside the .gitignore file to avoid pushing the data to GitHub. The folder has a lot of subfolders that are huge. Having this in my repo slows down VS Code's go-to-definition feature, track changes feature etc. Is there any way to prevent this from happening?

I tried including the folder under the watcher exclude in settings.json but that did not help.

答案1

得分: 1

使用files.exclude设置,并将"data/": true添加到其中。这将完全排除该文件夹不受VS Code的知识和功能影响(除非某个扩展程序覆盖您的设置以执行其他操作)。

除此之外,我不太确定您还能做什么。

我想您可以尝试将该文件夹中的文件强制关联到一些更简单解释的内容,不会受语言扩展的智能感知影响。您可以使用files.associations设置来实现这一点,类似于"files.associations": { "/data/**/*": "plaintext" }。我以前在自己的项目中做过这样的事情。

英文:

Use the files.exclude setting and add "data/": true to it. This will completely exclude the folder from VS Code's knowledge and features (unless an extension overrides your setting to do otherwise).

Other than that, I'm not sure what else you can do.

I suppose you could try to force the file associations for files in that folder to something that is interpreted more simply and doesn't get much intellisense by language extensions. You'd use the files.associations setting for that- something like "files.associations": { "/data/**/*": "plaintext" }. I've done that before in one of my own projects.

huangapple
  • 本文由 发表于 2023年2月27日 08:18:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/75575842.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定