Skip to content

Commit

Permalink
Make LaunchManager's IResourceDeltaVisitors more light weight
Browse files Browse the repository at this point in the history
Defer obtaining a delta's resource as long as possible and instead only
on the full-path of the delta.
  • Loading branch information
HannesWell committed Nov 14, 2024
1 parent c95b821 commit 0d45dcf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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:
Expand Down

0 comments on commit 0d45dcf

Please sign in to comment.