Spontaneous "file synchronization" on tens of thousands of files
Why does PhpStorm sometimes decide to do “file system synchronization” on a project, reporting that it is processing (indexing presumably?) every file in the folder including source control internal files? I assume that's what is going on when it says it is running on 45,633 files…
I have made a couple of file changes but nothing major. There is a symlink in the project to an external directory that has had a number of changes. What is going on?
请先登录再写评论。
Hi,
Basically, external changes to the project files may provoke a sync/indexing procedure and while file system synchronization is usually relatively fast, indexing may take some time to process.
What kind of files (file types) have you changed externally?
If they are not directly code-related or you do not need them to take part in code navigation/analysis, you may mark directories as Excluded (right-click > mark as > excluded) to exclude them from indexing. It is generally a good suggestion for files that can be changed externally (such as logs, caches, all sort of generated data, “node_modules”, etc).
Also, you may untick “Settings/Preferences | Appearance & Behavior | System Settings > Sync external changes > When switching to the IDE window or opening an editor tab” option to prevent IDE from syncing changes with the file system:
When this option is disabled, you still may invoke “File > Reload all from disk” option to sync changes manually.
I noticed this discussion when trying to find out why IntelliJ IDEA 2024.1.1 (Ultimate Edition) was synchronizing thousands of files after I ran `nox` in a Python project.
It turns out `nox` made multiple `virtualenv`s to run `flake8`, `black`, `isort`, etc., so IDEA was synchronizing all that. I'll try to exclude `.nox` from synchronization and see whether that helps.
I can't reproduce the problem right now, and I don't see a way to force a synchronization in the app, but the menu items I chose were…
Control-click on the `.nox` directory, choose "Mark Directory as" → "Excluded".