diff options
| author | Louis Orenstein | 2013-04-29 21:24:58 +0000 |
|---|---|---|
| committer | Jeffrey Overbey | 2013-04-29 21:24:58 +0000 |
| commit | 8ee1bc96b1bc119e585c75b672da5f1fa7057066 (patch) | |
| tree | f83b1034936d57d18ad644d3d740ac6189c2fe4a | |
| parent | 8001d7c3e486a2b9655daa7ae5d0d73a8c7df5a6 (diff) | |
| download | org.eclipse.photran-8ee1bc96b1bc119e585c75b672da5f1fa7057066.tar.gz org.eclipse.photran-8ee1bc96b1bc119e585c75b672da5f1fa7057066.tar.xz org.eclipse.photran-8ee1bc96b1bc119e585c75b672da5f1fa7057066.zip | |
Bug 400647 - Ensuring Index is up to date takes too long when Previewing
a refactoring a 2nd time
2 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java index 428828a7..b4ae4f07 100644 --- a/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java +++ b/org.eclipse.photran.core.vpg/src/org/eclipse/photran/internal/core/refactoring/infrastructure/FortranEditorRefactoring.java @@ -7,6 +7,7 @@ * * Contributors: * UIUC - Initial API and implementation + * Louis Orenstein (Tech-X Corporation) - fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=400647 *******************************************************************************/ package org.eclipse.photran.internal.core.refactoring.infrastructure; @@ -27,6 +28,7 @@ import org.eclipse.rephraserengine.core.refactorings.IEditorRefactoring; * This is a base class for all Photran refactorings that apply to a single file * and possibly require user input/selection * @author Jeff Overbey, Timofey Yuvashev + * @author Louis Orenstein (Tech-X Corporation) - fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=400647 */ public abstract class FortranEditorRefactoring extends FortranResourceRefactoring @@ -112,7 +114,7 @@ public abstract class FortranEditorRefactoring if (astOfFileInEditor == null) { // Re-acquire the AST, and re-analyze the selection - checkInitialConditions(pm); + checkInitialConditions(pm, true); } } } diff --git a/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java b/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java index c05e2bac..56b6ec2f 100644 --- a/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java +++ b/org.eclipse.rephraserengine.core/src/org/eclipse/rephraserengine/core/vpg/refactoring/VPGRefactoring.java @@ -10,6 +10,7 @@ import java.util.Collections; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jface.text.Region; import org.eclipse.ltk.core.refactoring.Change; @@ -29,6 +30,7 @@ import org.eclipse.text.edits.ReplaceEdit; * A refactoring which accesses a VPG. * * @author Jeff Overbey + * @author Louis Orenstein (Tech-X Corporation) - fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=400647 * * @param <A> AST type * @param <T> node/token type (i.e., the type returned by {@link IVPGNode#getASTNode()}) @@ -59,14 +61,22 @@ public abstract class VPGRefactoring<A, T, V extends EclipseVPG<A, T, ? extends /////////////////////////////////////////////////////////////////////////// @Override - public final RefactoringStatus checkInitialConditions(IProgressMonitor pm) + public final RefactoringStatus checkInitialConditions(IProgressMonitor pm) { + return checkInitialConditions(pm, false); + } + + public final RefactoringStatus checkInitialConditions(IProgressMonitor pm, boolean maskVPGFromPM) { this.vpg = getVPG(); RefactoringStatus status = new RefactoringStatus(); pm.beginTask(Messages.VPGRefactoring_EnsuringIndexIsUpToDate, IProgressMonitor.UNKNOWN); - vpg.ensureVPGIsUpToDate(pm); + if (maskVPGFromPM) { + vpg.ensureVPGIsUpToDate(new NullProgressMonitor()); + } else { + vpg.ensureVPGIsUpToDate(pm); + } pm.done(); try |
