Skip to content

Commit

Permalink
Merge pull request #93765 from Jordyfel/reimport-dependency-bug
Browse files Browse the repository at this point in the history
Fix reimport by scan parsing dependency paths incorrectly
  • Loading branch information
akien-mga committed Jul 8, 2024
2 parents 137b138 + 325081c commit 16d549a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,9 @@ bool EditorFileSystem::_update_scan_actions() {
//must reimport
reimports.push_back(full_path);
Vector<String> dependencies = _get_dependencies(full_path);
for (const String &dependency_path : dependencies) {
if (import_extensions.has(dependency_path.get_extension())) {
for (const String &dep : dependencies) {
const String &dependency_path = dep.contains("::") ? dep.get_slice("::", 0) : dep;
if (import_extensions.has(dep.get_extension())) {
reimports.push_back(dependency_path);
}
}
Expand Down Expand Up @@ -1762,7 +1763,8 @@ String EditorFileSystem::_get_global_script_class(const String &p_type, const St
void EditorFileSystem::_update_file_icon_path(EditorFileSystemDirectory::FileInfo *file_info) {
String icon_path;
if (file_info->script_class_icon_path.is_empty() && !file_info->deps.is_empty()) {
const String &script_path = file_info->deps[0]; // Assuming the first dependency is a script.
const String &script_dep = file_info->deps[0]; // Assuming the first dependency is a script.
const String &script_path = script_dep.contains("::") ? script_dep.get_slice("::", 2) : script_dep;
if (!script_path.is_empty()) {
String *cached = file_icon_cache.getptr(script_path);
if (cached) {
Expand Down

0 comments on commit 16d549a

Please sign in to comment.