NeuroAgent

How to Restore File Display in IntelliJ IDEA

Solution for fixing the issue where IntelliJ IDEA only shows folders instead of files after a crash. Includes restoring project configuration, resetting settings, and additional methods.

Question

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.

NeuroAgent

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

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 .idea directory)
  • Incorrect references in the modules.xml file to .iml module 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

  1. Find the .idea directory in your project root
  2. Check for the presence of modules.xml and files with the .iml extension
  3. If files are missing or corrupted:
    • Copy these files from another working project
    • Ensure that .iml file names are correctly specified in modules.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 .idea directory

bash
# 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

  1. Open the FileProject Structure menu
  2. Find the Reset button in the dialog window
  3. Click Reset to 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:

  1. Go to FileSettings
  2. Select EditorFile Types
  3. Find the Ignored files and folders section
  4. 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:

  1. FileProject Structure
  2. Go to the Modules section
  3. Ensure that all necessary project folders are added as content roots
  4. 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:

  1. FileInvalidate Caches / Restart
  2. In the dialog window, select Invalidate and Restart
  3. 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:

  1. Close the current project in IntelliJ IDEA
  2. Open the project by selecting FileOpen and specifying the project root folder
  3. 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:

  1. Regular backup of the .idea directory
  2. Using VCS (version control) to track configuration changes
  3. Properly closing IntelliJ IDEA before shutting down the computer
  4. 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

  1. IntelliJ does not show project folders - Stack Overflow
  2. Project view not showing directories – JetBrains Support
  3. How to fix a messed-up project view in IntelliJ Idea – JetBrains Support
  4. IntelliJ IDEA does not show some files? Know the hiding-places – JetBrains Blog
  5. Hide excluded folders from tree in IntelliJ IDEA – Stack Overflow
  6. Project tool window – IntelliJ IDEA Documentation
  7. 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:

  1. Restoring .idea files - copying modules.xml and .iml files from a working project
  2. Recreating the configuration - deleting and automatically recreating the .idea directory
  3. Resetting project settings - via FileProject StructureReset
  4. 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 FileOpen so that the IDE automatically recreates the configuration.