|
From: <caw...@us...> - 2007-06-11 21:01:00
|
Revision: 2599
http://svn.sourceforge.net/rubyeclipse/?rev=2599&view=rev
Author: cawilliams
Date: 2007-06-11 14:00:56 -0700 (Mon, 11 Jun 2007)
Log Message:
-----------
fix Trac ticket #4592 - Code folding breaks while you type
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyElementDelta.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDelta.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/folding/DefaultRubyFoldingStructureProvider.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyElementDelta.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyElementDelta.java 2007-06-11 20:37:30 UTC (rev 2598)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyElementDelta.java 2007-06-11 21:00:56 UTC (rev 2599)
@@ -11,7 +11,7 @@
package org.rubypeople.rdt.core;
import org.eclipse.core.resources.IResourceDelta;
-import org.rubypeople.rdt.internal.core.RubyScript;
+import org.jruby.ast.Node;
/**
* A Java element delta describes changes in Java element between two discrete
@@ -348,7 +348,7 @@
* @see #F_AST_AFFECTED
* @since 3.2
*/
- public RubyScript getRubyScriptAST();
+ public Node getRubyScriptAST();
/**
* Returns deltas for the children which have changed.
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java 2007-06-11 20:37:30 UTC (rev 2598)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ReconcileWorkingCopyOperation.java 2007-06-11 21:00:56 UTC (rev 2599)
@@ -125,8 +125,8 @@
this.problems = new HashMap();
this.ast = workingCopy.makeConsistent(true, this.problems, this.progressMonitor);
this.deltaBuilder.buildDeltas();
- // if (this.ast != null && this.deltaBuilder.delta != null)
- // this.deltaBuilder.delta.changedAST(this.ast);
+ if (this.ast != null && this.deltaBuilder.delta != null)
+ this.deltaBuilder.delta.changedAST(this.ast);
return this.ast;
}
if (this.ast != null)
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDelta.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDelta.java 2007-06-11 20:37:30 UTC (rev 2598)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyElementDelta.java 2007-06-11 21:00:56 UTC (rev 2599)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import org.eclipse.core.resources.IResourceDelta;
+import org.jruby.ast.Node;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyElementDelta;
@@ -32,7 +33,7 @@
* reconcile operation - the changed element is an IRubyScript in
* working copy mode
*/
- protected RubyScript ast = null;
+ protected Node ast = null;
/*
* The element that this delta describes the change to.
@@ -264,7 +265,7 @@
/*
* Records the last changed AST .
*/
- public void changedAST(RubyScript changedAST) {
+ public void changedAST(Node changedAST) {
this.ast = changedAST;
changed(F_AST_AFFECTED);
}
@@ -397,7 +398,7 @@
return parents;
}
- public RubyScript getRubyScriptAST() {
+ public Node getRubyScriptAST() {
return this.ast;
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/folding/DefaultRubyFoldingStructureProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/folding/DefaultRubyFoldingStructureProvider.java 2007-06-11 20:37:30 UTC (rev 2598)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/folding/DefaultRubyFoldingStructureProvider.java 2007-06-11 21:00:56 UTC (rev 2599)
@@ -535,6 +535,7 @@
*/
public void elementChanged(ElementChangedEvent e) {
IRubyElementDelta delta = findElement(fInput, e.getDelta());
+ if (delta.getRubyScriptAST() == null) return;
if (delta != null) processDelta(delta);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|