Without "excluding" folders, how can I stop Indexing intellij idea on start? It's very very annoying that it starts indexing on startup without allowing you to, for example, debug a test case making you wait until indexing has finished.
-
Did you let it finish indexing? After it has done so once, it shouldn't need to re-index on every startup (given that it can find the last index, and that it wasn't deleted for example if it was on temporary storage) – vikingsteve Apr 30 '15 at 12:37
-
16I let, but anyhow it's the developer who should decide his priorities, not the app. What if I have a 100,000 lines codebase, should I wait to get indexed even if I do NOT need any of the indexing results? Is it very expensive to add a switch? I definitely think Intellij Idea is a product with a lot of room for improvement with a very ironic product name. – Jaime Agudo Apr 30 '15 at 14:34
-
Most of the navigation features and so on within intellij require the indexing to be performed once. It's a one-time process, why is it such an issue? Besides if it's taking such a long time either your development machine is from 1980 or you are doing something wrong... – vikingsteve Apr 30 '15 at 14:35
-
2Oh yeah, I code with a x8086 when I don't have my Motorola 64k at hand ;) Each time you switch branches on a decent size project it re-starts indexing, I like git ;) And all my `target` folders are already excluded. I bet I am not the only one who suffers this on a MBP 2014 FYI. Obviously I am "doing something wrong" but I am afraid any of us have a clue. Thanks anyway. – Jaime Agudo Apr 30 '15 at 14:44
-
Well there's the clue that you omitted from your question. The indexing happens every time you switch branches... why don't you include that in your question, and add the `git` tag. – vikingsteve Apr 30 '15 at 14:47
-
You cannot debug a test case, because that requires the IDE to understand which classes reside in which files, and this requires a fully up-to-date index. Sorry. For branches that have diverged very much, the best workaround seems to have them in separate directories, and just open as separate projects. Then they'll only have to be indexed once. – Peter Gromov Apr 30 '15 at 17:23
-
19I assumed that git branch switch is VERY common, I know workarounds, I did *not* asked for them guys. Furthermore you are losing the point trying to convince me that is needed when it's not. I can debug in many languages without blocking the UI on the IDE. And coming back to the question all this context is irrelevant, does somebody know if it's possible to stop it or not? Assume I simply don't want to waste CPU time doing something. And you should disclaim that you are Jetbrains staff, please be objective and assume criticism, nobody is perfect ;) – Jaime Agudo Apr 30 '15 at 21:25
-
12There's no way to turn off indexing except for excluding folders or marking the files as binary. We (JetBrains) are working towards making branch switching less painful, but we're not very close to it right now. Debugging without a project-wide index might be perfectly possible in other languages; but in Java it's not (or we don't know how). – Peter Gromov Apr 30 '15 at 22:01
-
Probably cause I am _lazy_ person who loves Clojure laziness I'd encourage you to adopt its laziness on Idea, don't do anything till you really _need_ it ;) – Jaime Agudo Apr 30 '15 at 22:05
-
1Well, that wouldn't be a great user experience. Imagine, you start IDEA without indexing, you edit code for some time and then you debug your test case and stop on a breakpoint (or just invoke Goto Class). At that moment IDEA suddenly starts indexing and suggests you go get some coffee and entertain yourself for 10 minutes or so. I'd be quite disappointed, although I totally love Haskell/Clojure laziness as well :) In fact, many things in IDEA are already done lazily. But indexing seems too heavy for that. – Peter Gromov May 01 '15 at 07:03
-
30Yeah it's definitely a way better to BLOCK the UI for minutes straight away without a chance to opt out. And you are losing the point, it's not a "user experience", it's a "developer experience", someone who theoretically knows the implications of his decisions and who usually likes to be free to choose when he wants to wait and take the coffee and doesn't need a pretended "Intelligent" sw decide for himself. And I understand you but your opinion is biased @PeterGromov, you are paid to promote Idea mate, please don't take it personally – Jaime Agudo May 01 '15 at 09:35
-
8Block the UI? That's not expected and worth profiling and reporting to the tracker (see https://intellij-support.jetbrains.com/entries/29983118-Reporting-performance-problems). The editor/VCS should be responsive, though lacking "smart" functionality. I'm paid not for promoting but for developing IntelliJ IDEA, and from my experience people, even IDEA developers themselves, don't know well when index is required (in fact, for almost everything, therefore it's built immediately). I'm sorry for the troubles you're experiencing; providing CPU snapshots might help us fix them. – Peter Gromov May 01 '15 at 11:13
-
2I am with Peter here mostly. The UI is not blocked. You can still edit code. One thing that should be improved is the ability to run "external" run configurations (maven, gradle) while indexing. I created an issue: https://youtrack.jetbrains.com/issue/IDEA-163988 – eekboom Nov 15 '16 at 12:45
8 Answers
You can stop synchronizing/indexing each time you switch to the IDEA and it's quite useful when dealing with big projects and outside build process which triggers indexing.
Just disable checkbox System Settings -> Synchronize files on frame or editor tab activation
.
Make sure you run indexing manually to update hints when needed through Synchronize
menu (Cmd-Alt-Y on Mac) or File -> Reload All from Disk
to run it manually for IDEA 2020 running under Linux

- 1,814
- 1
- 16
- 14
-
1This should be considered as the accepted answer (even for latest 2018.3.x version) since it's the only way you can control when to synchronize and not getting back from a console (e.g. when you're running a test) to a frozen IntelliJ window. – Mache Jan 29 '19 at 13:31
-
I can't remember but I believe this option didn't exist at the time I posted the question :) – Jaime Agudo Feb 19 '20 at 09:14
-
where is the `Synchronize` menu? I can't seem to find it and the CMD + ALT + Y does nothing – Ben2307 Dec 01 '20 at 17:26
-
@Ben2307 under linux it's in `File -> Reload All from Disk`. Probably they had renamed it since the post. It's mapped to `Ctrl+Alt+Y` for me – Magomed Abdurakhmanov Dec 02 '20 at 10:06
-
@Magomed, I couldn't find the "Synchronize files on frame or editor tab activation". Version : 2021.2.1 – Raghu Jan 25 '22 at 09:57
-
4@Raghu it's under 'Appearance & Behavior -> System Settings' and now is called 'Synchronize external changes when switching to IDE...' – Magomed Abdurakhmanov Jan 26 '22 at 10:09
Try:
File-> Invalidate Caches / Restart.
I think that this issue happens (at least for me it seems to be the reason) if you start commit and then close the IDE in the middle of the process.

- 771
- 1
- 9
- 19
-
Worked perfectly when WebStorm failed indexing. (Stuck in an infinite loop whilst indexing figlet) – NBTX Aug 01 '19 at 20:52
-
1It will not work when PyCharm hangs on startup! no time to click on `File` – dashesy Oct 01 '19 at 17:44
Now, "excluding" folders is the only way to disable indexing when a change occurs in one of excluded folders (except for generated sources that mustn't be excluded).
Checked with Intellij 2016.2.5
I suggest you to tune your Intellij configuration, see this post : https://stackoverflow.com/a/22508853/779338
You Can easily resolve it.
Just Go to: File -> Setting -> Directories.
Stop all the files that are going to included and need to empty ADD Content Root.
Like This:

- 1,589
- 2
- 16
- 22

- 215
- 1
- 4
- 11
It may be because of libraries folder is added more than one sub folder in the project. example in my case i have node_modules folder in two locations in the project. one is under root directory(app-->node_modeules) another one is under(app-->test-->node_modules)
Simply Right click on each folder and then selected Mark Directory As --> Excluded
It resolved my problem. Hope it would be helpful.

- 903
- 7
- 11
After struggling with this issue for around a week and searching all the solution I came to below conclusion: either upgrade your intellij which gives you feature to pause the indexing ( I can't upgrade my intellij due to license issues ) so the other option was to disable all the plugins and then try enabling as per the need one by one.
After enabling any of the plugin if you see it behaving the same uninstall the plugin and download some alternative of it.

- 2,066
- 3
- 19
- 33
If longer indexing is an issue you can enable the shared indexes.
Add this plugin in your intellij and follow the instructions from here.

- 15,456
- 11
- 71
- 120
In my case i had constantly indexing files in Angular application when i remove node_modules folder.
I've tried to invalidate caches multiple times what didn't help at all.
Only solution was to remove project with clear Git state and reclone project - than everything started to work just flawlessly.

- 59
- 1
- 7