From 0d45dcf7b3ae67be2bed3468b80836279233cc05 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Thu, 18 Jul 2024 23:00:02 +0200 Subject: [PATCH] Make LaunchManager's IResourceDeltaVisitors more light weight Defer obtaining a delta's resource as long as possible and instead only on the full-path of the delta. --- .../core/org/eclipse/debug/internal/core/LaunchManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java index 88a6939ed53..80a62dfea10 100644 --- a/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java +++ b/debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java @@ -542,7 +542,7 @@ public static String serializeDocument(Document doc, String lineDelimiter) throw return false; } if (0 != (delta.getFlags() & IResourceDelta.OPEN)) { - if (delta.getResource() instanceof IProject project) { + if (delta.getFullPath().segmentCount() == 1 && delta.getResource() instanceof IProject project) { if (project.isOpen()) { LaunchManager.this.projectOpened(project); } else { @@ -551,8 +551,8 @@ public static String serializeDocument(Document doc, String lineDelimiter) throw } return false; } - if (delta.getResource() instanceof IFile file) { - if (LAUNCH_CONFIG_FILE_EXTENSIONS.contains(file.getFileExtension())) { + if (LAUNCH_CONFIG_FILE_EXTENSIONS.contains(delta.getFullPath().getFileExtension())) { + if (delta.getResource() instanceof IFile file) { ILaunchConfiguration handle = new LaunchConfiguration(file); switch (delta.getKind()) { case IResourceDelta.ADDED: