Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ project files suddenly broken

I've been working on a project in IntelliJ IDEA for about two months now. Today, when I fired up the IDE, which would usually open project straight up, IntelliJ took unusually long time to load, and when it did open the project, the main .java file displayed a long line of spaces and nothing else, instead of the code that was there before. The .iml file, the only other thing in the project, was fine. An error message was on the top:

"This document contains very long lines. Soft wraps were forcibly enabled to improve editor performance."

Trying to edit the document results in the entire program freezing and becoming unresponsive. What the hell happened? It was fine one day and then just did this, how do I get my project back and how do I prevent this?

like image 973
Sargon1 Avatar asked Nov 16 '15 17:11

Sargon1


People also ask

How do I recover deleted files in IntelliJ?

Restore deleted files If you've accidentally deleted a file that was not under version control, you can restore it with Local History. Select the node that contained the file you deleted in the Project tool window, right-click it and choose Local History | Show History from the context menu.

Where are IntelliJ project files stored?

By default, IntelliJ IDEA stores user-specific files for each IDE instance (configuration, caches, plugins, logs, and so on) in the user's home directory. However, you can change the location for storing those files, if necessary.


1 Answers

Solved in the comments below the question; thought I might as well post a dummy answer and mark this as resolved.

EDIT: Solution written out.

  1. Right click on file > Local History > Show History

  2. Find any suspicious changes in the list on the left. Be especially on lookout for "External changes", as those can indicate crashes and sudden power-outs. Alternatively, look for times when you remember your computer crashed or power went out while IntelliJ was open.

  3. Revert the changes(curved purple arrow in the upper left corner). Restart the IDE if it's going slow. Everything should work properly now.

like image 170
Sargon1 Avatar answered Oct 03 '22 04:10

Sargon1