The FileSystem Dock is Godot's primary asset browser within the editor. It provides a visual tree and list of the project's res:// directory, displays resource type icons and thumbnails, handles file operations (import, move, delete, rename, duplicate), and integrates with the EditorFileSystem scanning backend to track and monitor project resources.
This page documents the FileSystem Dock UI (editor/docks/filesystem_dock.cpp), the background scanning system (editor/file_system/editor_file_system.cpp), and the associated data structures used for directory management and dependency tracking.
The FileSystem Dock coordinates three layers: the editor UI (FileSystemDock), the background scanning system (EditorFileSystem), and the core resource I/O infrastructure.
Component Map
Sources: editor/docks/filesystem_dock.cpp31-76 editor/file_system/editor_file_system.cpp31-59 editor/file_system/editor_file_system.h56-61
editor/docks/filesystem_dock.cpp)The main UI panel that renders the project's file structure. It provides both a tree view (FileSystemTree) and an item list view (FileSystemList) for browsing files.
Primary responsibilities:
create_tooltip_for_path() editor/docks/filesystem_dock.cpp78-92FileSystemList::edit_selected() manages the inline UI for renaming files, calculating the appropriate popup rectangle based on icon mode (ItemList::ICON_MODE_TOP vs ItemList::ICON_MODE_LEFT) editor/docks/filesystem_dock.cpp113-166_line_editor_submit() handles the commitment of name changes from the inline editor, emitting the item_edited signal editor/docks/filesystem_dock.cpp97-111Sources: editor/docks/filesystem_dock.cpp81-87 editor/docks/filesystem_dock.cpp97-111 editor/docks/filesystem_dock.cpp113-166
editor/file_system/editor_file_system.cpp)A background singleton that scans the physical disk and maintains an in-memory representation of the project structure.
| Responsibility | Details |
|---|---|
| Persistence | Maintains filesystem_cache10 to store scanned metadata across sessions editor/file_system/editor_file_system.cpp61 |
| Tree Structure | Organizes data into EditorFileSystemDirectory nodes editor/file_system/editor_file_system.cpp63-132 |
| Script Classes | Tracks script class names and inheritance via class_info editor/file_system/editor_file_system.cpp182-190 |
| Metadata | Stores modification times, UIDs, and import validity editor/file_system/editor_file_system.cpp167-180 |
Sources: editor/file_system/editor_file_system.cpp56-61 editor/file_system/editor_file_system.cpp138-141 editor/file_system/editor_file_system.cpp172-180
The scanning process populates the EditorFileSystemDirectory tree. This tree is then used by the UI to render the project structure.
Scanning Logic Flow
EditorFileSystemDirectory provides methods to resolve paths and dependencies:
get_path(): Reconstructs the res:// path by walking up to the root and joining directory names editor/file_system/editor_file_system.cpp106-132get_file_deps(): Retrieves resource dependencies, resolving UIDs to paths via the ResourceUID singleton editor/file_system/editor_file_system.cpp143-165Sources: editor/file_system/editor_file_system.cpp63-80 editor/file_system/editor_file_system.cpp106-132 editor/file_system/editor_file_system.cpp143-165
editor/editor_interface.cpp)The EditorInterface singleton provides access to various editor functionalities, including the EditorFileSystem.
get_resource_filesystem(): Returns the EditorFileSystem singleton editor/editor_interface.cpp88-90get_editor_settings(): Returns the editor's EditorSettings instance editor/editor_interface.cpp104-106get_current_directory() and get_current_path().Sources: editor/editor_interface.cpp88-90 editor/editor_interface.cpp104-106
editor/settings/editor_settings.cpp)The EditorSettings class manages project-independent editor configurations doc/classes/EditorSettings.xml4-8
get_favorites() returns the list of favorite files and directories for this project doc/classes/EditorSettings.xml120-125get_recent_dirs() returns recently visited folders in file dialogs doc/classes/EditorSettings.xml135-140get_project_metadata() and set_project_metadata() handle project-specific state doc/classes/EditorSettings.xml126-134add_shortcut() doc/classes/EditorSettings.xml73-83Sources: doc/classes/EditorSettings.xml4-8 doc/classes/EditorSettings.xml120-125 doc/classes/EditorSettings.xml126-134 doc/classes/EditorSettings.xml135-140
editor/gui/editor_quick_open_dialog.cpp)The EditorQuickOpenDialog provides a fuzzy-search interface for resources, acting as a lightweight alternative to the FileSystem Dock for opening specific files.
Quick Open Sequence
EditorQuickOpenDialog::popup_dialog() is called with base types editor/gui/editor_quick_open_dialog.cpp155-168_search_box_text_changed() editor/gui/editor_quick_open_dialog.cpp137HighlightedLabel::draw_substr_rects() editor/gui/editor_quick_open_dialog.cpp59-77Sources: editor/gui/editor_quick_open_dialog.cpp59-77 editor/gui/editor_quick_open_dialog.cpp155-168
Godot uses ResourceUID to ensure that moving files in the FileSystem Dock does not break references.
| Entity | Role in FileSystem |
|---|---|
ResourceUID | Singleton mapping unique IDs (uid://...) to current res:// paths editor/file_system/editor_file_system.cpp153-161 |
EditorFileSystemDirectory | Stores the UID for every file tracked by the system editor/file_system/editor_file_system.cpp138-141 |
ResourceFormatLoader | Can retrieve UIDs via get_resource_uid() core/io/resource_loader.cpp118-129 |
Code Entity Interaction: Dependency Resolution
Sources: editor/file_system/editor_file_system.cpp138-141 editor/file_system/editor_file_system.cpp143-165 core/io/resource_loader.cpp118-129
The SceneTreeDock interacts with the FileSystem Dock when instantiating scenes or managing drag-and-drop.
Key Interaction Functions:
SceneTreeDock::_nodes_drag_begin(): Sets up the drag state when nodes are moved editor/docks/scene_tree_dock.cpp79-83SceneTreeDock::_quick_open(): Instantiates a scene from a path provided by the FileSystem or Quick Open dialog editor/docks/scene_tree_dock.cpp85-87SceneTreeDock::_handle_hover_to_inspect(): Handles inspecting nodes when hovering in the tree editor/docks/scene_tree_dock.cpp125-139Sources: editor/docks/scene_tree_dock.cpp79-83 editor/docks/scene_tree_dock.cpp85-87 editor/docks/scene_tree_dock.cpp125-139
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.