How to restore the display of all files in IntelliJ IDEA after an improper shutdown?
In IntelliJ IDEA, the Project view previously displayed all files, including files in the project root. After an improper computer shutdown (power outage), something changed in the settings, and now only folders are displayed. Files only become visible when switching the Project view to Project Files.
Please advise which settings need to be changed to restore the previous project display view? I cannot find the corresponding parameter myself.
When IntelliJ IDEA Only Shows Folders but Not Files in Project View After Improper Shutdown
If IntelliJ IDEA after an improper shutdown only displays folders but doesn’t show files in the Project view, this is typically related to corruption of project configuration files or changes to display settings. The main solutions include restoring .idea files, resetting project settings, or correcting file configuration display.
Table of Contents
- Basic Reasons for the Problem
- Restoring Project Configuration
- File Display Settings
- Additional Solution Methods
- Preventing Future Problems
Basic Reasons for the Problem
The issue with only showing folders instead of files in the Project view in IntelliJ IDEA after a crash is most commonly caused by the following factors:
- Damage to project configuration files (files in the
.ideadirectory) - Incorrect references in the
modules.xmlfile to.imlmodule files - Changes to file ignore settings in IDE settings
- Project cache or file indexing issues
As users note on Stack Overflow, after an improper shutdown, modules.xml and .iml files in the .idea directory often disappear or become corrupted.
Restoring Project Configuration
Method 1: Restoring .idea files
- Find the
.ideadirectory in your project root - Check for the presence of
modules.xmland files with the.imlextension - If files are missing or corrupted:
- Copy these files from another working project
- Ensure that
.imlfile names are correctly specified inmodules.xml - As described in the Stack Overflow solution, this often resolves the issue
Method 2: Complete Configuration Restoration
If restoring files didn’t help, you can completely recreate the project configuration:
Important: First, create a backup of the
.ideadirectory
# Rename the old configuration
mv .idea .idea.backup
# Restart IntelliJ IDEA
# The IDE will automatically create a new configuration
As recommended in JetBrains support, after recreating the .idea folder, the project will start working correctly again.
Method 3: Resetting Project Structure via Menu
- Open the
File→Project Structuremenu - Find the
Resetbutton in the dialog window - Click
Resetto restore the default project structure
This method is mentioned in a JetBrains community post as an effective way to fix a “broken” project view in IntelliJ IDEA.
File Display Settings
Checking File Ignore Settings
Often the problem occurs because files have been accidentally added to the ignore list:
- Go to
File→Settings - Select
Editor→File Types - Find the
Ignored files and folderssection - Remove file extensions or patterns from the list that might be hiding your files
As explained in the IntelliJ IDEA documentation, this is where settings responsible for file visibility are often located.
Switching Between Views
Note the difference between:
- Project view - displays module structure and root elements
- Project Files view - displays the project file system
As noted in a Stack Overflow answer, in newer versions of IntelliJ IDEA, these views have different display settings.
Restoring Project Root Elements
Sometimes after a crash, project content root elements are lost:
File→Project Structure- Go to the
Modulessection - Ensure that all necessary project folders are added as content roots
- If any are missing - click
+and add the missing folders
This method was successfully applied by a user on Stack Overflow to restore folder visibility.
Additional Solution Methods
Clearing Cache and Restarting
Sometimes the problem is solved simply by clearing the cache:
File→Invalidate Caches / Restart- In the dialog window, select
Invalidate and Restart - Confirm the action
This method is mentioned in a JetBrains community solution as an effective way to restore functionality after crashes.
Recreating Project from Sources
If none of the methods helped:
- Close the current project in IntelliJ IDEA
- Open the project by selecting
File→Openand specifying the project root folder - When opening, the IDE will offer to recreate the project configuration
As recommended on Reddit, this method often resolves display issues after crashes.
Preventing Future Problems
To avoid similar problems in the future:
- Regular backup of the
.ideadirectory - Using VCS (version control) to track configuration changes
- Properly closing IntelliJ IDEA before shutting down the computer
- Automatic saving of project settings (enabled by default)
The IntelliJ IDEA documentation also recommends regularly updating the IDE to the latest versions, as many display issues are fixed in releases.
Sources
- IntelliJ does not show project folders - Stack Overflow
- Project view not showing directories – JetBrains Support
- How to fix a messed-up project view in IntelliJ Idea – JetBrains Support
- IntelliJ IDEA does not show some files? Know the hiding-places – JetBrains Blog
- Hide excluded folders from tree in IntelliJ IDEA – Stack Overflow
- Project tool window – IntelliJ IDEA Documentation
- Can’t see project folders in IntelliJ IDEA – Stack Overflow
Conclusion
The issue with only showing folders instead of files in IntelliJ IDEA after a crash is typically resolved by one of the following methods:
- Restoring
.ideafiles - copyingmodules.xmland.imlfiles from a working project - Recreating the configuration - deleting and automatically recreating the
.ideadirectory - Resetting project settings - via
File→Project Structure→Reset - Correcting ignore settings - checking the list of ignored files in settings
To prevent similar problems in the future, it’s recommended to regularly create backups of the project configuration and properly close IntelliJ IDEA before shutting down the computer. If none of the methods helped, try opening the project again via File → Open so that the IDE automatically recreates the configuration.