You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: <caw...@us...> - 2007-08-21 18:08:35
|
Revision: 3022
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3022&view=rev
Author: cawilliams
Date: 2007-08-21 11:08:33 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
move quick fixes for problems defined in RDT core into RDT UI. Keep com.aptana.rdt.ui to only do quick fixes for com.aptana.rdt
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.xml
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/CorrectionProposal.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/QuickFixProcessor.java
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-08-21 18:03:57 UTC (rev 3021)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-08-21 18:08:33 UTC (rev 3022)
@@ -1498,4 +1498,11 @@
<startup class="org.rubypeople.rdt.internal.ui.ForceIndexer"/>
<startup class="org.rubypeople.rdt.internal.ui.RubyInstalledDetector"/>
</extension>
+ <extension
+ point="org.rubypeople.rdt.ui.quickFixProcessors">
+ <quickFixProcessor
+ class="org.rubypeople.rdt.internal.ui.text.correction.QuickFixProcessor"
+ id="org.rubypeople.rdt.ui.quickFixProcessor"
+ name="Default Quick Fix Processor"/>
+ </extension>
</plugin>
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/CorrectionProposal.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/CorrectionProposal.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/CorrectionProposal.java 2007-08-21 18:08:33 UTC (rev 3022)
@@ -0,0 +1,25 @@
+package org.rubypeople.rdt.internal.ui.text.correction;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.swt.graphics.Image;
+import org.rubypeople.rdt.internal.ui.text.ruby.RubyCompletionProposal;
+
+public class CorrectionProposal extends RubyCompletionProposal {
+
+ public CorrectionProposal(String replacementString, int replacementOffset, int replacementLength, Image image, String displayString, int relevance) {
+ super(replacementString, replacementOffset, replacementLength, image, displayString, relevance);
+ }
+
+ @Override
+ protected boolean isValidPrefix(String prefix) {
+ return true;
+ }
+
+ @Override
+ public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
+ IDocument document= viewer.getDocument();
+ apply(document, trigger, getReplacementOffset());
+ }
+
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/CorrectionProposal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/QuickFixProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/QuickFixProcessor.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/QuickFixProcessor.java 2007-08-21 18:08:33 UTC (rev 3022)
@@ -0,0 +1,76 @@
+package org.rubypeople.rdt.internal.ui.text.correction;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.jruby.ast.visitor.rewriter.DefaultFormatHelper;
+import org.jruby.ast.visitor.rewriter.FormatHelper;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.compiler.IProblem;
+import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.ui.text.ruby.IInvocationContext;
+import org.rubypeople.rdt.ui.text.ruby.IProblemLocation;
+import org.rubypeople.rdt.ui.text.ruby.IQuickFixProcessor;
+import org.rubypeople.rdt.ui.text.ruby.IRubyCompletionProposal;
+
+public class QuickFixProcessor implements IQuickFixProcessor {
+
+ public IRubyCompletionProposal[] getCorrections(IInvocationContext context, IProblemLocation[] locations) throws CoreException {
+ if (locations == null || locations.length == 0) {
+ return null;
+ }
+
+ HashSet<Integer> handledProblems = new HashSet<Integer>(locations.length);
+ ArrayList<IRubyCompletionProposal> resultingCollections = new ArrayList<IRubyCompletionProposal>();
+ for (int i = 0; i < locations.length; i++) {
+ IProblemLocation curr = locations[i];
+ Integer id = new Integer(curr.getProblemId());
+ if (handledProblems.add(id)) {
+ process(context, curr, resultingCollections);
+ }
+ }
+ return (IRubyCompletionProposal[]) resultingCollections.toArray(new IRubyCompletionProposal[resultingCollections.size()]);
+ }
+
+ private void process(IInvocationContext context, IProblemLocation problem, Collection<IRubyCompletionProposal> proposals) throws CoreException {
+ int id = problem.getProblemId();
+ if (id == 0) { // no proposals for none-problem locations
+ return;
+ }
+ switch (id) {
+ case IProblem.UnusedPrivateMethod:
+ case IProblem.UnusedPrivateField:
+ case IProblem.LocalVariableIsNeverUsed:
+ case IProblem.ArgumentIsNeverUsed:
+ addUnusedMemberProposal(context, problem, proposals);
+ break;
+ default:
+ }
+ }
+
+ protected FormatHelper getFormatHelper() {
+ return new DefaultFormatHelper();
+ }
+
+ public boolean hasCorrections(IRubyScript unit, int problemId) {
+ switch (problemId) {
+ case IProblem.UnusedPrivateMethod:
+ case IProblem.UnusedPrivateField:
+ case IProblem.LocalVariableIsNeverUsed:
+ case IProblem.ArgumentIsNeverUsed:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ public static void addUnusedMemberProposal(IInvocationContext context, IProblemLocation problem, Collection<IRubyCompletionProposal> proposals) {
+ Image image= RubyPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
+ CorrectionProposal proposal = new CorrectionProposal("", problem.getOffset(), problem.getLength(), image, "clean up unused code", 100);
+ proposals.add(proposal);
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/correction/QuickFixProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 18:04:01
|
Revision: 3021
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3021&view=rev
Author: cawilliams
Date: 2007-08-21 11:03:57 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/ConstantNamingConvention.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/LocalAndMethodNamingConvention.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/MethodMissingWithoutRespondTo.java
Added Paths:
-----------
trunk/com.aptana.rdt/src/com/aptana/rdt/IProblem.java
Added: trunk/com.aptana.rdt/src/com/aptana/rdt/IProblem.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/IProblem.java (rev 0)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/IProblem.java 2007-08-21 18:03:57 UTC (rev 3021)
@@ -0,0 +1,8 @@
+package com.aptana.rdt;
+
+public interface IProblem {
+ public static final int MisspelledConstructor = 128;
+ public static final int ConstantNamingConvention = 129;
+ public static final int MethodMissingWithoutRespondTo = 130;
+ public static final int LocalAndMethodNamingConvention = 131;
+}
Property changes on: trunk/com.aptana.rdt/src/com/aptana/rdt/IProblem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/ConstantNamingConvention.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/ConstantNamingConvention.java 2007-08-21 17:01:53 UTC (rev 3020)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/ConstantNamingConvention.java 2007-08-21 18:03:57 UTC (rev 3021)
@@ -7,11 +7,10 @@
import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.AptanaRDTPlugin;
+import com.aptana.rdt.IProblem;
public class ConstantNamingConvention extends RubyLintVisitor {
- public static final int PROBLEM_ID = 1234568;
-
public ConstantNamingConvention(String contents) {
super(contents);
}
@@ -34,7 +33,7 @@
@Override
protected int getProblemID() {
- return PROBLEM_ID;
+ return IProblem.ConstantNamingConvention;
}
}
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/LocalAndMethodNamingConvention.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/LocalAndMethodNamingConvention.java 2007-08-21 17:01:53 UTC (rev 3020)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/LocalAndMethodNamingConvention.java 2007-08-21 18:03:57 UTC (rev 3021)
@@ -7,6 +7,7 @@
import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.AptanaRDTPlugin;
+import com.aptana.rdt.IProblem;
public class LocalAndMethodNamingConvention extends RubyLintVisitor {
@@ -46,4 +47,9 @@
return super.visitDefsNode(iVisited);
}
+ @Override
+ protected int getProblemID() {
+ return IProblem.LocalAndMethodNamingConvention;
+ }
+
}
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/MethodMissingWithoutRespondTo.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/MethodMissingWithoutRespondTo.java 2007-08-21 17:01:53 UTC (rev 3020)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/MethodMissingWithoutRespondTo.java 2007-08-21 18:03:57 UTC (rev 3021)
@@ -9,10 +9,10 @@
import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.AptanaRDTPlugin;
+import com.aptana.rdt.IProblem;
public class MethodMissingWithoutRespondTo extends RubyLintVisitor {
- public static final int PROBLEM_ID = 1234569;
private static final String RESPOND_TO = "respond_to?";
private static final String METHOD_MISSING = "method_missing";
@@ -44,7 +44,7 @@
@Override
protected int getProblemID() {
- return PROBLEM_ID;
+ return IProblem.MethodMissingWithoutRespondTo;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 17:01:57
|
Revision: 3020
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3020&view=rev
Author: cawilliams
Date: 2007-08-21 10:01:53 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
update to latest patch, which prints parentheses around method arguments (rather than spaces)
Added Paths:
-----------
trunk/org.jruby/lib/jruby.jar
Removed Paths:
-------------
trunk/org.jruby/lib/jruby.jar
Deleted: trunk/org.jruby/lib/jruby.jar
===================================================================
--- trunk/org.jruby/lib/jruby.jar 2007-08-21 16:51:00 UTC (rev 3019)
+++ trunk/org.jruby/lib/jruby.jar 2007-08-21 17:01:53 UTC (rev 3020)
@@ -1,16361 +0,0 @@
-PK
- |
|
From: <caw...@us...> - 2007-08-21 16:51:06
|
Revision: 3019
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3019&view=rev
Author: cawilliams
Date: 2007-08-21 09:51:00 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
use correction change image for proposals
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java 2007-08-21 16:48:02 UTC (rev 3018)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java 2007-08-21 16:51:00 UTC (rev 3019)
@@ -5,6 +5,7 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.ui.RubyUI;
import org.rubypeople.rdt.ui.text.ruby.IInvocationContext;
import org.rubypeople.rdt.ui.text.ruby.IProblemLocation;
import org.rubypeople.rdt.ui.text.ruby.IRubyCompletionProposal;
@@ -22,7 +23,7 @@
}
public static void addReplacementProposal(int offset, int length, String replacement, String display, Collection<IRubyCompletionProposal> proposals) {
- Image image= RubyPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ Image image= RubyUI.getSharedImages().getImage(org.rubypeople.rdt.ui.ISharedImages.IMG_OBJS_CORRECTION_CHANGE);
CorrectionProposal proposal = new CorrectionProposal(replacement, offset, length, image, display, 100);
proposals.add(proposal);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 16:48:12
|
Revision: 3018
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3018&view=rev
Author: cawilliams
Date: 2007-08-21 09:48:02 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedParameterVisitor.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedPrivateMethodVisitor.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedParameterVisitor.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedParameterVisitor.java 2007-08-21 16:40:09 UTC (rev 3017)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedParameterVisitor.java 2007-08-21 16:48:02 UTC (rev 3018)
@@ -12,6 +12,9 @@
import org.jruby.ast.LocalVarNode;
import org.jruby.ast.Node;
import org.jruby.evaluator.Instruction;
+import org.jruby.lexer.yacc.IDESourcePosition;
+import org.jruby.lexer.yacc.ISourcePosition;
+import org.rubypeople.rdt.core.compiler.IProblem;
import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
@@ -41,7 +44,10 @@
public void exitDefnNode(DefnNode iVisited) {
for (Node unused : declared.values()) {
- createProblem(unused.getPosition(), "Unused Method parameter " + ASTUtil.getNameReflectively(unused));
+ String name = ASTUtil.getNameReflectively(unused);
+ ISourcePosition original = unused.getPosition();
+ ISourcePosition pos = new IDESourcePosition(original.getFile(), original.getStartLine(), original.getEndLine(), original.getStartOffset(), original.getStartOffset() + name.length());
+ createProblem(pos, "Unused Method parameter " + name);
}
declared.clear();
}
@@ -70,4 +76,8 @@
return super.visitLocalVarNode(iVisited);
}
+ @Override
+ protected int getProblemID() {
+ return IProblem.ArgumentIsNeverUsed;
+ }
}
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedPrivateMethodVisitor.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedPrivateMethodVisitor.java 2007-08-21 16:40:09 UTC (rev 3017)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/UnusedPrivateMethodVisitor.java 2007-08-21 16:48:02 UTC (rev 3018)
@@ -14,6 +14,7 @@
import org.jruby.ast.VCallNode;
import org.jruby.evaluator.Instruction;
import org.jruby.runtime.Visibility;
+import org.rubypeople.rdt.core.compiler.IProblem;
import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
@@ -84,5 +85,10 @@
protected String getOptionKey() {
return AptanaRDTPlugin.COMPILER_PB_UNUSED_PRIVATE_MEMBER;
}
+
+ @Override
+ protected int getProblemID() {
+ return IProblem.UnusedPrivateMethod;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 16:40:15
|
Revision: 3017
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3017&view=rev
Author: cawilliams
Date: 2007-08-21 09:40:09 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
add correction change image
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/icons/full/obj16/correction_change.gif
Added: trunk/org.rubypeople.rdt.ui/icons/full/obj16/correction_change.gif
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.ui/icons/full/obj16/correction_change.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-08-21 14:46:08 UTC (rev 3016)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-08-21 16:40:09 UTC (rev 3017)
@@ -62,6 +62,7 @@
public static final String IMG_OBJS_LIBRARY= NAME_PREFIX + "library_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_EXTJAR= NAME_PREFIX + "jar_l_obj.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_EXTJAR_WSRC= NAME_PREFIX + "jar_lsrc_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_CORRECTION_CHANGE= NAME_PREFIX + "correction_change.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_SEARCH_READACCESS= NAME_PREFIX + "occ_read.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_SEARCH_WRITEACCESS= NAME_PREFIX + "occ_write.gif"; //$NON-NLS-1$
@@ -109,6 +110,7 @@
public static final ImageDescriptor DESC_OBJS_LIBRARY= createManagedFromKey(T_OBJ, IMG_OBJS_LIBRARY);
public static final ImageDescriptor DESC_OBJS_EXTJAR= createManagedFromKey(T_OBJ, IMG_OBJS_EXTJAR);
public static final ImageDescriptor DESC_OBJS_EXTJAR_WSRC= createManagedFromKey(T_OBJ, IMG_OBJS_EXTJAR_WSRC);
+ public static final ImageDescriptor DESC_OBJS_CORRECTION_CHANGE= createManagedFromKey(T_OBJ, IMG_OBJS_CORRECTION_CHANGE);
public static final ImageDescriptor DESC_OBJS_ENV_VAR= createManagedFromKey(T_OBJ, IMG_OBJS_ENV_VAR);
public static final ImageDescriptor DESC_OBJS_SEARCH_DECL= createManagedFromKey(T_OBJ, IMG_OBJS_SEARCH_DECL);
public static final ImageDescriptor DESC_OBJS_SEARCH_REF= createManagedFromKey(T_OBJ, IMG_OBJS_SEARCH_REF);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java 2007-08-21 14:46:08 UTC (rev 3016)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java 2007-08-21 16:40:09 UTC (rev 3017)
@@ -28,6 +28,12 @@
* @since 1.0.0
*/
public static final String IMG_OBJS_EXTERNAL_ARCHIVE_WITH_SOURCE= RubyPluginImages.IMG_OBJS_EXTJAR_WSRC;
+
+ /**
+ * Key to access the shared image or image descriptor for correction changes.
+ * @since 1.0.0
+ */
+ public static final String IMG_OBJS_CORRECTION_CHANGE= RubyPluginImages.IMG_OBJS_CORRECTION_CHANGE;
Image getImage(String key);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 14:46:11
|
Revision: 3016
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3016&view=rev
Author: cawilliams
Date: 2007-08-21 07:46:08 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Removed Paths:
-------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/symbols/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 14:33:47
|
Revision: 3015
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3015&view=rev
Author: cawilliams
Date: 2007-08-21 07:33:45 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
fix #5609 - Syntax coloring broken after closing string with content that looks like a regexp
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-08-21 14:14:43 UTC (rev 3014)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyTokenScanner.java 2007-08-21 14:33:45 UTC (rev 3015)
@@ -36,7 +36,7 @@
private static String[] fgTokenProperties = { IRubyColorConstants.RUBY_KEYWORD, IRubyColorConstants.RUBY_DEFAULT,
IRubyColorConstants.RUBY_FIXNUM, IRubyColorConstants.RUBY_CHARACTER, IRubyColorConstants.RUBY_SYMBOL,
IRubyColorConstants.RUBY_INSTANCE_VARIABLE, IRubyColorConstants.RUBY_GLOBAL,
- IRubyColorConstants.RUBY_REGEXP, IRubyColorConstants.RUBY_ERROR
+ IRubyColorConstants.RUBY_ERROR
// TODO Add Ability to set colors for return and operators
// IRubyColorConstants.RUBY_METHOD_NAME,
// IRubyColorConstants.RUBY_KEYWORD_RETURN,
@@ -50,7 +50,6 @@
private int fTokenLength;
private int fOffset;
- private boolean isInRegexp;
private boolean isInSymbol;
private boolean inAlias;
private RubyParserResult result;
@@ -114,8 +113,6 @@
private Token doGetToken(String key) {
if (isInSymbol)
return getToken(IRubyColorConstants.RUBY_SYMBOL);
- if (isInRegexp)
- return getToken(IRubyColorConstants.RUBY_REGEXP);
return getToken(key);
}
@@ -159,12 +156,6 @@
if ((((fOffset - origOffset) + 1) < fContents.length()) && (fContents.charAt((fOffset - origOffset) + 1) == '?'))
return doGetToken(IRubyColorConstants.RUBY_CHARACTER);
return doGetToken(IRubyColorConstants.RUBY_FIXNUM);
- case Tokens.tREGEXP_BEG:
- isInRegexp = true;
- return doGetToken(IRubyColorConstants.RUBY_REGEXP);
- case Tokens.tREGEXP_END:
- isInRegexp = false;
- return doGetToken(IRubyColorConstants.RUBY_REGEXP);
default:
return doGetToken(IRubyColorConstants.RUBY_DEFAULT);
}
@@ -261,9 +252,6 @@
lexer.setState(LexState.EXPR_BEG);
parserSupport.initTopLocalVariables();
isInSymbol = false;
- if (offset == 0) {
- isInRegexp = false;
- }
try {
fContents = document.get(offset, length);
lexerSource = new LexerSource("filename", new StringReader(fContents), 0, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 14:14:48
|
Revision: 3014
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3014&view=rev
Author: cawilliams
Date: 2007-08-21 07:14:43 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPairMatcher.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPairMatcher.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPairMatcher.java 2007-08-21 14:05:14 UTC (rev 3013)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPairMatcher.java 2007-08-21 14:14:43 UTC (rev 3014)
@@ -29,9 +29,11 @@
import org.jruby.ast.SClassNode;
import org.jruby.ast.WhenNode;
import org.jruby.ast.WhileNode;
+import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.ti.util.ClosestSpanningNodeLocator;
import org.rubypeople.rdt.internal.ti.util.INodeAcceptor;
+import org.rubypeople.rdt.internal.ui.RubyPlugin;
/**
* Helper class for match pairs of characters.
@@ -79,8 +81,17 @@
if (src.length() == 0) {
return false;
}
- RubyParser parser = new RubyParser();
- Node root = parser.parse(src);
+ Node root;
+ try {
+ RubyParser parser = new RubyParser();
+ root = parser.parse(src);
+ } catch (SyntaxException e) {
+ // ignore
+ return false;
+ } catch (RuntimeException e) {
+ RubyPlugin.log(e);
+ return false;
+ }
Node spanning = ClosestSpanningNodeLocator.Instance().findClosestSpanner(root, fOffset, new INodeAcceptor() {
public boolean doesAccept(Node node) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 14:05:16
|
Revision: 3013
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3013&view=rev
Author: cawilliams
Date: 2007-08-21 07:05:14 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
enable finding occurrences of method calls in file
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesFinder.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesFinder.java 2007-08-21 13:48:10 UTC (rev 3012)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesFinder.java 2007-08-21 14:05:14 UTC (rev 3013)
@@ -16,6 +16,7 @@
import org.jruby.ast.ArgumentNode;
import org.jruby.ast.BlockArgNode;
import org.jruby.ast.BlockNode;
+import org.jruby.ast.CallNode;
import org.jruby.ast.ClassNode;
import org.jruby.ast.ClassVarAsgnNode;
import org.jruby.ast.ClassVarDeclNode;
@@ -27,6 +28,7 @@
import org.jruby.ast.DVarNode;
import org.jruby.ast.DefnNode;
import org.jruby.ast.DefsNode;
+import org.jruby.ast.FCallNode;
import org.jruby.ast.GlobalAsgnNode;
import org.jruby.ast.GlobalVarNode;
import org.jruby.ast.InstAsgnNode;
@@ -37,6 +39,8 @@
import org.jruby.ast.Node;
import org.jruby.ast.ReturnNode;
import org.jruby.ast.SymbolNode;
+import org.jruby.ast.VCallNode;
+import org.jruby.ast.types.INameNode;
import org.jruby.lexer.yacc.IDESourcePosition;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.lexer.yacc.SyntaxException;
@@ -197,9 +201,9 @@
pushSymbolRefs(root, fSelectedNode, fUsages);
}
- // if ( isMethodRefNode(fSelectedNode)) {
- // pushMethodRefs( root, fSelectedNode, occurrences );
- // }
+ if ( fMarkMethodOccurrences && isMethodRefNode(fSelectedNode)) {
+ pushMethodRefs( root, fSelectedNode, fUsages );
+ }
if (fMarkConstantOccurrences && isConstRef(fSelectedNode)) {
pushConstRefs(root, fSelectedNode, fUsages);
@@ -232,6 +236,10 @@
return positions;
}
+ private boolean isMethodRefNode(Node selectedNode) {
+ return selectedNode instanceof VCallNode || selectedNode instanceof FCallNode || selectedNode instanceof CallNode;
+ }
+
// ****************************************************************************
// *
// * Reference kind definitions
@@ -602,7 +610,30 @@
if (searchResult instanceof ConstDeclNode) fWriteUsages.add(searchResult);
}
}
+
+ /**
+ * Collects all pertinent method calls
+ */
+ private void pushMethodRefs(Node root, Node orig, List<Node> occurrences) {
+ if (!isMethodRefNode(orig)) {
+ return;
+ }
+ final String matchName = ASTUtil.getNameReflectively(orig);
+ List<Node> searchResults = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
+ public boolean doesAccept(Node node) {
+ if (isMethodRefNode(node)) {
+ return ASTUtil.getNameReflectively(node).equals(matchName);
+ }
+ return false;
+ }
+ });
+
+ for (Node searchResult : searchResults) {
+ occurrences.add(searchResult);
+ }
+ }
+
/**
* Collects all pertinent type ref occurrences
*/
@@ -698,8 +729,17 @@
// one
name = ((SymbolNode) node).getName();
return new IDESourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getStartOffset(), pos.getStartOffset() + name.length() + 1);
+ } else if (node instanceof CallNode) {
+ CallNode vcall = (CallNode) node;
+ name = vcall.getName();
+ String receiver = ASTUtil.stringRepresentation(vcall.getReceiverNode());
+ int start = pos.getStartOffset() + receiver.length() + 1;
+ return new IDESourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), start, start + name.length());
+ } else if (node instanceof INameNode) {
+ INameNode vcall = (INameNode) node;
+ name = vcall.getName();
+ return new IDESourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getStartOffset(), pos.getStartOffset() + name.length());
}
-
if (name == null) {
throw new RuntimeException("Couldn't get the name for: " + node.toString());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 13:48:12
|
Revision: 3012
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3012&view=rev
Author: cawilliams
Date: 2007-08-21 06:48:10 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
fix context menu search
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeReferencePattern.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeReferencePattern.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeReferencePattern.java 2007-08-21 13:48:03 UTC (rev 3011)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/TypeReferencePattern.java 2007-08-21 13:48:10 UTC (rev 3012)
@@ -30,8 +30,11 @@
public TypeReferencePattern(char[] qualification, char[] simpleName, int matchRule) {
this(matchRule);
-
- this.qualification = isCaseSensitive() ? qualification : CharOperation.toLowerCase(qualification);
+ if (qualification.length == 0) {
+ this.qualification = null;
+ } else {
+ this.qualification = isCaseSensitive() ? qualification : CharOperation.toLowerCase(qualification);
+ }
this.simpleName = (isCaseSensitive() || isCamelCase()) ? simpleName : CharOperation.toLowerCase(simpleName);
if (simpleName == null)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-21 13:48:09
|
Revision: 3011
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3011&view=rev
Author: cawilliams
Date: 2007-08-21 06:48:03 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
fix context menu search
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindAction.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindAction.java 2007-08-20 16:02:39 UTC (rev 3010)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/FindAction.java 2007-08-21 13:48:03 UTC (rev 3011)
@@ -242,8 +242,8 @@
}
/**
- * Executes this action for the given java element.
- * @param element The java element to be found.
+ * Executes this action for the given ruby element.
+ * @param element The ruby element to be found.
*/
public void run(IRubyElement element) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-20 16:02:41
|
Revision: 3010
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3010&view=rev
Author: cawilliams
Date: 2007-08-20 09:02:39 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
if we can't get path ro ruby on windows, just try C:\ruby. If we can't get path to ruby on *nix/Mac, or we got "/usr/bin" try /usr/local and then /opt/local
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-08-20 13:55:35 UTC (rev 3009)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-08-20 16:02:39 UTC (rev 3010)
@@ -267,6 +267,9 @@
break;
}
}
+ if (rubyExecutable == null) { // if all else fails, just try "C:/ruby"
+ rubyExecutable = new File("C:" + File.separator + "ruby" + File.separator + "bin" + File.separator + "ruby.exe");
+ }
} else { // Mac, Linux - so let's just run 'which ruby' and parse out the result
String[] cmdLine = new String[] { "which", "ruby" }; //$NON-NLS-1$ //$NON-NLS-2$
Process p = null;
@@ -293,10 +296,14 @@
p.destroy();
}
}
- // If we find one at /usr/bin/ruby, try to see if there's one at /usr/local/bin/ruby. If so, then prefer that.
- if (rubyExecutable != null && rubyExecutable.getAbsolutePath().startsWith("/usr/bin")) {
+ // If we don;t find ruby, or we find one at /usr/bin/ruby:
+ // try to see if there's one at /usr/local or /opt/local. If so, then prefer one of those.
+ if (rubyExecutable == null || rubyExecutable.getAbsolutePath().startsWith("/usr/bin")) {
File rubyHome = tryLocation(new File("/usr/local/bin/ruby"));
if (rubyHome != null) return rubyHome;
+
+ rubyHome = tryLocation(new File("/opt/local/bin/ruby"));
+ if (rubyHome != null) return rubyHome;
}
}
return tryLocation(rubyExecutable);
@@ -307,7 +314,7 @@
return null;
}
- File bin= new File(rubyExecutable.getParent());
+ File bin = rubyExecutable.getParentFile();
if (!bin.exists()) return null;
File rubyHome = bin.getParentFile();
if (!rubyHome.exists()) return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-20 13:55:36
|
Revision: 3009
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3009&view=rev
Author: cawilliams
Date: 2007-08-20 06:55:35 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-20 13:17:20 UTC (rev 3008)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-20 13:55:35 UTC (rev 3009)
@@ -61,6 +61,7 @@
public class GemManager implements IGemManager {
+ private static final String INSTALLATION_DIRECTORY = "INSTALLATION DIRECTORY:";
private static final String INCLUDE_DEPENDENCIES_SWITCH = "-y";
private static final String LOCAL_SWITCH = "-l";
private static final String LIST_COMMAND = "list";
@@ -607,10 +608,13 @@
List<String> commands = new ArrayList<String>();
commands.add("environment");
String output = execAndReadOutput(commands);
+ if (output == null) return null;
String[] lines = output.split("\n");
if (lines == null || lines.length < 3) return null;
String path = lines[2];
- path = path.substring(path.indexOf("INSTALLATION DIRECTORY:") + 23);
+ int index = path.indexOf(INSTALLATION_DIRECTORY);
+ if (index == -1) return null;
+ path = path.substring(index + INSTALLATION_DIRECTORY.length());
fGemInstallPath = new Path(path.trim());
}
return fGemInstallPath;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-20 13:17:27
|
Revision: 3008
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3008&view=rev
Author: cawilliams
Date: 2007-08-20 06:17:20 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
set warning for possible accidental boolean assignment on the assignment position (not full if body)
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/AccidentalBooleanAssignmentVisitor.java
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/AccidentalBooleanAssignmentVisitor.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/AccidentalBooleanAssignmentVisitor.java 2007-08-17 18:04:15 UTC (rev 3007)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/AccidentalBooleanAssignmentVisitor.java 2007-08-20 13:17:20 UTC (rev 3008)
@@ -25,7 +25,7 @@
public Instruction visitIfNode(IfNode iVisited) {
Node condition = iVisited.getCondition();
if (containsAssignment(condition)) {
- createProblem(iVisited.getPosition(), "Possible accidental boolean assignment");
+ createProblem(condition.getPosition(), "Possible accidental boolean assignment");
}
return super.visitIfNode(iVisited);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 18:04:16
|
Revision: 3007
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3007&view=rev
Author: cawilliams
Date: 2007-08-17 11:04:15 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix discouraged access warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassFileNameChangeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/FileNameChangeProvider.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java 2007-08-17 18:00:51 UTC (rev 3006)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java 2007-08-17 18:04:15 UTC (rev 3007)
@@ -32,7 +32,6 @@
import java.util.Collection;
import java.util.Map;
-import org.eclipse.core.internal.resources.File;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -158,11 +157,11 @@
return compositeChange;
}
- private Collection<File> getAllAffectedFiles(Change change) {
- Collection<File> affectedFiles = new ArrayList<File>();
+ private Collection<IFile> getAllAffectedFiles(Change change) {
+ Collection<IFile> affectedFiles = new ArrayList<IFile>();
for (Object object : change.getAffectedObjects()) {
- if (object instanceof File) {
- affectedFiles.add((File) object);
+ if (object instanceof IFile) {
+ affectedFiles.add((IFile) object);
}
}
return affectedFiles;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassFileNameChangeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassFileNameChangeProvider.java 2007-08-17 18:00:51 UTC (rev 3006)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassFileNameChangeProvider.java 2007-08-17 18:04:15 UTC (rev 3007)
@@ -4,7 +4,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.resources.IFile;
import org.rubypeople.rdt.refactoring.editprovider.FileNameChangeProvider;
public class RenameClassFileNameChangeProvider extends FileNameChangeProvider {
@@ -16,9 +16,9 @@
}
@Override
- public Map<String, String> getFilesToRename(Collection<File> objects) {
+ public Map<String, String> getFilesToRename(Collection<IFile> objects) {
HashMap<String, String> filesToRename = new HashMap<String, String>();
- for (File file : objects) {
+ for (IFile file : objects) {
String name = file.getName();
name = name.replaceAll("\\." + file.getFileExtension() + "$", "");
if(name.equals(config.getSelectedNode().getCPath().getName())) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/FileNameChangeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/FileNameChangeProvider.java 2007-08-17 18:00:51 UTC (rev 3006)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/FileNameChangeProvider.java 2007-08-17 18:04:15 UTC (rev 3007)
@@ -4,11 +4,11 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.resources.IFile;
public class FileNameChangeProvider {
- public Map<String, String> getFilesToRename(Collection<File> objects) {
+ public Map<String, String> getFilesToRename(Collection<IFile> objects) {
return new HashMap<String, String>();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 18:00:52
|
Revision: 3006
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3006&view=rev
Author: cawilliams
Date: 2007-08-17 11:00:51 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix up warnings
Modified Paths:
--------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
Added Paths:
-----------
trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/LogicalGem.java
Removed Paths:
-------------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java
Copied: trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/LogicalGem.java (from rev 2866, trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java)
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/LogicalGem.java (rev 0)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/core/gems/LogicalGem.java 2007-08-17 18:00:51 UTC (rev 3006)
@@ -0,0 +1,79 @@
+package com.aptana.rdt.core.gems;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+
+public class LogicalGem extends Gem {
+
+ private LogicalGem(String name, String version, String description) {
+ super(name, version, description);
+ }
+
+ public static LogicalGem create(Collection<Gem> gems) {
+ if (gems == null || gems.isEmpty()) throw new IllegalArgumentException("Need a non-null, non-empty Collection of Gems");
+ String name = null;
+ String description = null;
+ String version = "(";
+ for (Gem gem : gems) {
+ if (name == null) name = gem.getName();
+ if (description == null) description = gem.getDescription();
+ version += gem.getVersion() + ", ";
+ }
+ version = version.substring(0, version.length() - 2);
+ version += ')';
+ // XXX Need to take platform into account!!!!!!!!
+ return new LogicalGem(name, version, description);
+ }
+
+ public SortedSet<String> getVersions() {
+ String raw = getVersion().substring(1, getVersion().length() - 1);
+ SortedSet<String> version = new TreeSet<String>(new VersionComparator());
+ StringTokenizer tokenizer = new StringTokenizer(raw, ",");
+ while (tokenizer.hasMoreTokens()) {
+ version.add(tokenizer.nextToken().trim());
+ }
+ return version;
+ }
+
+ private class VersionComparator implements Comparator {
+
+ public int compare(Object o1, Object o2) {
+ String v1 = (String) o1;
+ String v2 = (String) o2;
+
+ List<Integer> v1Parts = getParts(v1);
+ List<Integer> v2Parts = getParts(v2);
+ int blah = Math.min(v1Parts.size(), v2Parts.size());
+ for (int i = 0; i < blah; i++) {
+ Integer one = v1Parts.get(i);
+ Integer two = v2Parts.get(i);
+ int result = one.compareTo(two);
+ if (result != 0) return result;
+ }
+ // if parts sizes aren't equal, the one with more parts is newer.
+ if (v1Parts.size() > v2Parts.size()) {
+ return 1;
+ } else if (v2Parts.size() > v1Parts.size()) {
+ return -1;
+ }
+ return 0;
+ }
+
+ private List<Integer> getParts(String version) {
+ StringTokenizer tokenizer = new StringTokenizer(version, ".");
+ List<Integer> parts = new ArrayList<Integer>();
+ while (tokenizer.hasMoreTokens()) {
+ parts.add(Integer.parseInt(tokenizer.nextToken()));
+ }
+ return parts;
+ }
+
+ }
+
+}
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-17 18:00:43 UTC (rev 3005)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-17 18:00:51 UTC (rev 3006)
@@ -57,6 +57,7 @@
import com.aptana.rdt.core.gems.Gem;
import com.aptana.rdt.core.gems.GemListener;
import com.aptana.rdt.core.gems.IGemManager;
+import com.aptana.rdt.core.gems.LogicalGem;
public class GemManager implements IGemManager {
Deleted: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java 2007-08-17 18:00:43 UTC (rev 3005)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/LogicalGem.java 2007-08-17 18:00:51 UTC (rev 3006)
@@ -1,80 +0,0 @@
-package com.aptana.rdt.internal.core.gems;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
-
-import com.aptana.rdt.core.gems.Gem;
-
-public class LogicalGem extends Gem {
-
- private LogicalGem(String name, String version, String description) {
- super(name, version, description);
- }
-
- public static LogicalGem create(Collection<Gem> gems) {
- if (gems == null || gems.isEmpty()) throw new IllegalArgumentException("Need a non-null, non-empty Collection of Gems");
- String name = null;
- String description = null;
- String version = "(";
- for (Gem gem : gems) {
- if (name == null) name = gem.getName();
- if (description == null) description = gem.getDescription();
- version += gem.getVersion() + ", ";
- }
- version = version.substring(0, version.length() - 2);
- version += ')';
- // XXX Need to take platform into account!!!!!!!!
- return new LogicalGem(name, version, description);
- }
-
- public SortedSet<String> getVersions() {
- String raw = getVersion().substring(1, getVersion().length() - 1);
- SortedSet<String> version = new TreeSet<String>(new VersionComparator());
- StringTokenizer tokenizer = new StringTokenizer(raw, ",");
- while (tokenizer.hasMoreTokens()) {
- version.add(tokenizer.nextToken().trim());
- }
- return version;
- }
-
- private class VersionComparator implements Comparator {
-
- public int compare(Object o1, Object o2) {
- String v1 = (String) o1;
- String v2 = (String) o2;
-
- List<Integer> v1Parts = getParts(v1);
- List<Integer> v2Parts = getParts(v2);
- int blah = Math.min(v1Parts.size(), v2Parts.size());
- for (int i = 0; i < blah; i++) {
- Integer one = v1Parts.get(i);
- Integer two = v2Parts.get(i);
- int result = one.compareTo(two);
- if (result != 0) return result;
- }
- // if parts sizes aren't equal, the one with more parts is newer.
- if (v1Parts.size() > v2Parts.size()) {
- return 1;
- } else if (v2Parts.size() > v1Parts.size()) {
- return -1;
- }
- return 0;
- }
-
- private List<Integer> getParts(String version) {
- StringTokenizer tokenizer = new StringTokenizer(version, ".");
- List<Integer> parts = new ArrayList<Integer>();
- while (tokenizer.hasMoreTokens()) {
- parts.add(Integer.parseInt(tokenizer.nextToken()));
- }
- return parts;
- }
-
- }
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 18:00:44
|
Revision: 3005
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3005&view=rev
Author: cawilliams
Date: 2007-08-17 11:00:43 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix up warnings
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RefreshGemsActionDelegate.java
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RemoveGemActionDelegate.java
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateGemActionDelegate.java
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/gems/InstallGemDialog.java
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RefreshGemsActionDelegate.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RefreshGemsActionDelegate.java 2007-08-17 17:58:58 UTC (rev 3004)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RefreshGemsActionDelegate.java 2007-08-17 18:00:43 UTC (rev 3005)
@@ -18,7 +18,6 @@
import org.eclipse.ui.IWorkbenchPart;
import com.aptana.rdt.AptanaRDTPlugin;
-import com.aptana.rdt.internal.core.gems.GemManager;
/**
* Install a gem
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RemoveGemActionDelegate.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RemoveGemActionDelegate.java 2007-08-17 17:58:58 UTC (rev 3004)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/RemoveGemActionDelegate.java 2007-08-17 18:00:43 UTC (rev 3005)
@@ -20,7 +20,6 @@
import com.aptana.rdt.AptanaRDTPlugin;
import com.aptana.rdt.core.gems.Gem;
-import com.aptana.rdt.internal.core.gems.GemManager;
import com.aptana.rdt.ui.gems.GemsMessages;
import com.aptana.rdt.ui.gems.GemsView;
import com.aptana.rdt.ui.gems.RemoveGemDialog;
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java 2007-08-17 17:58:58 UTC (rev 3004)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateAllActionDelegate.java 2007-08-17 18:00:43 UTC (rev 3005)
@@ -17,7 +17,6 @@
import org.eclipse.ui.IWorkbenchPart;
import com.aptana.rdt.AptanaRDTPlugin;
-import com.aptana.rdt.internal.core.gems.GemManager;
/**
* Install a gem
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateGemActionDelegate.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateGemActionDelegate.java 2007-08-17 17:58:58 UTC (rev 3004)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/actions/UpdateGemActionDelegate.java 2007-08-17 18:00:43 UTC (rev 3005)
@@ -19,7 +19,6 @@
import com.aptana.rdt.AptanaRDTPlugin;
import com.aptana.rdt.core.gems.Gem;
-import com.aptana.rdt.internal.core.gems.GemManager;
import com.aptana.rdt.ui.gems.GemsView;
/**
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java 2007-08-17 17:58:58 UTC (rev 3004)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java 2007-08-17 18:00:43 UTC (rev 3005)
@@ -16,7 +16,6 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.compiler.IProblem;
import org.rubypeople.rdt.core.formatter.Indents;
-import org.rubypeople.rdt.internal.formatter.IndentationState;
import org.rubypeople.rdt.internal.ti.util.ClosestSpanningNodeLocator;
import org.rubypeople.rdt.internal.ti.util.INodeAcceptor;
import org.rubypeople.rdt.internal.ui.rubyeditor.ASTProvider;
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/gems/InstallGemDialog.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/gems/InstallGemDialog.java 2007-08-17 17:58:58 UTC (rev 3004)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/ui/gems/InstallGemDialog.java 2007-08-17 18:00:43 UTC (rev 3005)
@@ -28,8 +28,7 @@
import com.aptana.rdt.AptanaRDTPlugin;
import com.aptana.rdt.core.gems.Gem;
-import com.aptana.rdt.internal.core.gems.GemManager;
-import com.aptana.rdt.internal.core.gems.LogicalGem;
+import com.aptana.rdt.core.gems.LogicalGem;
public class InstallGemDialog extends Dialog {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 17:59:00
|
Revision: 3004
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3004&view=rev
Author: cawilliams
Date: 2007-08-17 10:58:58 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix discouraged access warnings
Modified Paths:
--------------
trunk/com.aptana.rdt/META-INF/MANIFEST.MF
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/DynamicVariableAliasesLocal.java
Added Paths:
-----------
trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/XMLWriter.java
Modified: trunk/com.aptana.rdt/META-INF/MANIFEST.MF
===================================================================
--- trunk/com.aptana.rdt/META-INF/MANIFEST.MF 2007-08-17 17:53:42 UTC (rev 3003)
+++ trunk/com.aptana.rdt/META-INF/MANIFEST.MF 2007-08-17 17:58:58 UTC (rev 3004)
@@ -10,7 +10,7 @@
Export-Package: com.aptana.rdt,
com.aptana.rdt.core.gems,
com.aptana.rdt.internal.core.gems;x-friends:="com.aptana.rdt.tests",
- com.aptana.rdt.internal.parser.warnings;x-friends:="com.aptana.rdt.tests",
+ com.aptana.rdt.internal.parser.warnings;x-friends:="com.aptana.rdt.tests,com.aptana.rdt.ui",
com.aptana.rdt.launching
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-17 17:53:42 UTC (rev 3003)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-08-17 17:58:58 UTC (rev 3004)
@@ -29,7 +29,6 @@
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.core.internal.resources.XMLWriter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
Added: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/XMLWriter.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/XMLWriter.java (rev 0)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/XMLWriter.java 2007-08-17 17:58:58 UTC (rev 3004)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package com.aptana.rdt.internal.core.gems;
+
+import java.io.*;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * A simple XML writer.
+ */
+public class XMLWriter extends PrintWriter {
+ protected int tab;
+
+ /* constants */
+ protected static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$
+
+ public XMLWriter(OutputStream output) throws UnsupportedEncodingException {
+ super(new OutputStreamWriter(output, "UTF8")); //$NON-NLS-1$
+ tab = 0;
+ println(XML_VERSION);
+ }
+
+ public void endTag(String name) {
+ tab--;
+ printTag('/' + name, null);
+ }
+
+ public void printSimpleTag(String name, Object value) {
+ if (value != null) {
+ printTag(name, null, true, false);
+ print(getEscaped(String.valueOf(value)));
+ printTag('/' + name, null, false, true);
+ }
+ }
+
+ public void printTabulation() {
+ for (int i = 0; i < tab; i++)
+ super.print('\t');
+ }
+
+ public void printTag(String name, HashMap parameters) {
+ printTag(name, parameters, true, true);
+ }
+
+ public void printTag(String name, HashMap parameters, boolean shouldTab, boolean newLine) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<"); //$NON-NLS-1$
+ sb.append(name);
+ if (parameters != null)
+ for (Iterator it = parameters.keySet().iterator(); it.hasNext();) {
+ sb.append(" "); //$NON-NLS-1$
+ String key = (String) it.next();
+ sb.append(key);
+ sb.append("=\""); //$NON-NLS-1$
+ sb.append(getEscaped(String.valueOf(parameters.get(key))));
+ sb.append("\""); //$NON-NLS-1$
+ }
+ sb.append(">"); //$NON-NLS-1$
+ if (shouldTab)
+ printTabulation();
+ if (newLine)
+ println(sb.toString());
+ else
+ print(sb.toString());
+ }
+
+ public void startTag(String name, HashMap parameters) {
+ startTag(name, parameters, true);
+ }
+
+ public void startTag(String name, HashMap parameters, boolean newLine) {
+ printTag(name, parameters, true, newLine);
+ tab++;
+ }
+
+ private static void appendEscapedChar(StringBuffer buffer, char c) {
+ String replacement = getReplacement(c);
+ if (replacement != null) {
+ buffer.append('&');
+ buffer.append(replacement);
+ buffer.append(';');
+ } else {
+ buffer.append(c);
+ }
+ }
+
+ public static String getEscaped(String s) {
+ StringBuffer result = new StringBuffer(s.length() + 10);
+ for (int i = 0; i < s.length(); ++i)
+ appendEscapedChar(result, s.charAt(i));
+ return result.toString();
+ }
+
+ private static String getReplacement(char c) {
+ // Encode special XML characters into the equivalent character references.
+ // These five are defined by default for all XML documents.
+ switch (c) {
+ case '<' :
+ return "lt"; //$NON-NLS-1$
+ case '>' :
+ return "gt"; //$NON-NLS-1$
+ case '"' :
+ return "quot"; //$NON-NLS-1$
+ case '\'' :
+ return "apos"; //$NON-NLS-1$
+ case '&' :
+ return "amp"; //$NON-NLS-1$
+ }
+ return null;
+ }
+}
Property changes on: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/XMLWriter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/DynamicVariableAliasesLocal.java
===================================================================
--- trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/DynamicVariableAliasesLocal.java 2007-08-17 17:53:42 UTC (rev 3003)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/parser/warnings/DynamicVariableAliasesLocal.java 2007-08-17 17:58:58 UTC (rev 3004)
@@ -2,7 +2,6 @@
import java.util.List;
-import org.jruby.ast.ArrayNode;
import org.jruby.ast.IterNode;
import org.jruby.ast.ListNode;
import org.jruby.ast.LocalAsgnNode;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 17:53:43
|
Revision: 3003
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3003&view=rev
Author: cawilliams
Date: 2007-08-17 10:53:42 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/org.jruby/lib/jruby.jar
Removed Paths:
-------------
trunk/org.jruby/lib/jruby.jar
Deleted: trunk/org.jruby/lib/jruby.jar
===================================================================
(Binary files differ)
Added: trunk/org.jruby/lib/jruby.jar
===================================================================
--- trunk/org.jruby/lib/jruby.jar (rev 0)
+++ trunk/org.jruby/lib/jruby.jar 2007-08-17 17:53:42 UTC (rev 3003)
@@ -0,0 +1,16361 @@
+PK
+ |
|
From: <caw...@us...> - 2007-08-17 17:51:57
|
Revision: 3002
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3002&view=rev
Author: cawilliams
Date: 2007-08-17 10:51:56 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix broken code
Modified Paths:
--------------
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_CodeComplexity.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_ComparableInclusionVisitor.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_EnumerableInclusionVisitor.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_SimilarVariableNameVisitor.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_UnecessaryElseVisitor.java
trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/WarningVisitorTest.java
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_CodeComplexity.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_CodeComplexity.java 2007-08-17 16:09:33 UTC (rev 3001)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_CodeComplexity.java 2007-08-17 17:51:56 UTC (rev 3002)
@@ -1,6 +1,6 @@
package com.aptana.rdt.internal.core.parser.warnings;
-import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
+import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.internal.parser.warnings.TooManyLocalsVisitor;
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_ComparableInclusionVisitor.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_ComparableInclusionVisitor.java 2007-08-17 16:09:33 UTC (rev 3001)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_ComparableInclusionVisitor.java 2007-08-17 17:51:56 UTC (rev 3002)
@@ -1,6 +1,6 @@
package com.aptana.rdt.internal.core.parser.warnings;
-import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
+import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.internal.parser.warnings.ComparableInclusionVisitor;
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_EnumerableInclusionVisitor.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_EnumerableInclusionVisitor.java 2007-08-17 16:09:33 UTC (rev 3001)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_EnumerableInclusionVisitor.java 2007-08-17 17:51:56 UTC (rev 3002)
@@ -1,6 +1,6 @@
package com.aptana.rdt.internal.core.parser.warnings;
-import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
+import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.internal.parser.warnings.EnumerableInclusionVisitor;
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_SimilarVariableNameVisitor.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_SimilarVariableNameVisitor.java 2007-08-17 16:09:33 UTC (rev 3001)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_SimilarVariableNameVisitor.java 2007-08-17 17:51:56 UTC (rev 3002)
@@ -1,8 +1,7 @@
package com.aptana.rdt.internal.core.parser.warnings;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.internal.core.RubyModelManager;
-import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
+import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.internal.parser.warnings.SimilarVariableNameVisitor;
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_UnecessaryElseVisitor.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_UnecessaryElseVisitor.java 2007-08-17 16:09:33 UTC (rev 3001)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/TC_UnecessaryElseVisitor.java 2007-08-17 17:51:56 UTC (rev 3002)
@@ -1,7 +1,6 @@
package com.aptana.rdt.internal.core.parser.warnings;
-import org.rubypeople.rdt.core.IProblemRequestor;
-import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
+import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import com.aptana.rdt.internal.parser.warnings.UnecessaryElseVisitor;
Modified: trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/WarningVisitorTest.java
===================================================================
--- trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/WarningVisitorTest.java 2007-08-17 16:09:33 UTC (rev 3001)
+++ trunk/com.aptana.rdt.tests/src/com/aptana/rdt/internal/core/parser/warnings/WarningVisitorTest.java 2007-08-17 17:51:56 UTC (rev 3002)
@@ -7,9 +7,9 @@
import org.jruby.ast.Node;
import org.rubypeople.rdt.core.compiler.IProblem;
+import org.rubypeople.rdt.core.parser.warnings.DelegatingVisitor;
+import org.rubypeople.rdt.core.parser.warnings.RubyLintVisitor;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
-import org.rubypeople.rdt.internal.core.parser.warnings.DelegatingVisitor;
-import org.rubypeople.rdt.internal.core.parser.warnings.RubyLintVisitor;
public abstract class WarningVisitorTest extends TestCase {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 16:09:45
|
Revision: 3001
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3001&view=rev
Author: cawilliams
Date: 2007-08-17 09:09:33 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix #5582 - Right-click search menu options are broken
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/MatchLocator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/MatchLocator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/MatchLocator.java 2007-08-17 16:09:27 UTC (rev 3000)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/search/matching/MatchLocator.java 2007-08-17 16:09:33 UTC (rev 3001)
@@ -107,7 +107,7 @@
}
public static IRubyElement getProjectOrJar(IRubyElement element) {
- while (!(element instanceof IRubyProject) && !(element instanceof ExternalSourceFolderRoot)) {
+ while (!(element instanceof IRubyProject)) {
element = element.getParent();
}
return element;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 16:09:45
|
Revision: 3000
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3000&view=rev
Author: cawilliams
Date: 2007-08-17 09:09:27 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix #5582 - Right-click search menu options are broken
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.xml
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.properties
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OccurrencesSearchMenuAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/RDTQuickMenuAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OpenRubySearchPageAction.java
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-08-17 15:44:05 UTC (rev 2999)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-08-17 16:09:27 UTC (rev 3000)
@@ -952,7 +952,246 @@
</actionSetPartAssociation>
</extension>
+ <!-- Begin Ruby Search action set -->
<extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="%RubySearchActionSet.label"
+ description="%RubySearchActionSet.description"
+ visible="false"
+ id="org.rubypeople.rdt.ui.SearchActionSet">
+<!-- see http://bugs.eclipse.org/bugs/show_bug.cgi?id=15684 -->
+<!-- Note: The menu (re-) definition has to be here due to bug: -->
+<!-- =================================================================== -->
+<!-- Search Menu -->
+<!-- =================================================================== -->
+ <menu
+ label="%searchMenu.label"
+ path="navigate"
+ id="org.eclipse.search.menu">
+ <groupMarker name="internalDialogGroup"/> <!-- not to be used by clients -->
+ <groupMarker name="dialogGroup"/> <!-- to be used by clients -->
+ <separator name="fileSearchContextMenuActionsGroup"/> <!-- to be used by clients -->
+ <separator name="contextMenuActionsGroup"/> <!-- to be used by clients -->
+ <separator name="occurencesActionsGroup"/> <!-- to be used by clients -->
+ <separator name="extraSearchGroup"/> <!-- to be used by clients -->
+ </menu>
+<!-- dialog group -->
+ <action
+ label="%openRubySearchPageAction.label"
+ icon="$nl$/icons/full/obj16/rsearch_obj.gif"
+ helpContextId="rubysearch_action_context"
+ class="org.rubypeople.rdt.internal.ui.search.OpenRubySearchPageAction"
+ menubarPath="org.eclipse.search.menu/dialogGroup"
+ id="org.rubypeople.rdt.ui.actions.OpenRubySearchPage">
+ </action>
+<!-- context menu group -->
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.occurrences.in.file.quickMenu"
+ label="%occurrencesSubMenu.label"
+ style="pulldown"
+ class="org.rubypeople.rdt.internal.ui.actions.OccurrencesSearchMenuAction"
+ menubarPath="org.eclipse.search.menu/occurencesActionsGroup"
+ id="org.rubypeople.rdt.internal.ui.actions.OccurrencesSearchMenuAction">
+ </action>
+ <menu
+ label="%writeAccessSubMenu.label"
+ path="org.eclipse.search.menu/contextMenuActionsGroup"
+ id="writeAccessSubMenu">
+ <separator
+ name="group1">
+ </separator>
+ </menu>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.occurrences.in.file"
+ label="%OccurrencesInFile.label"
+ retarget="true"
+ id="org.rubypeople.rdt.ui.actions.OccurrencesInFile">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.write.access.in.working.set"
+ label="%InWorkingSet.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/writeAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.WriteAccessInWorkingSet">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.write.access.in.hierarchy"
+ label="%InHierarchy.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/writeAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.WriteAccessInHierarchy">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.write.access.in.project"
+ label="%InProject.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/writeAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.WriteAccessInProject">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.write.access.in.workspace"
+ label="%InWorkspace.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/writeAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.WriteAccessInWorkspace">
+ </action>
+ <menu
+ label="%readAccessSubMenu.label"
+ path="org.eclipse.search.menu/contextMenuActionsGroup"
+ id="readAccessSubMenu">
+ <separator
+ name="group1">
+ </separator>
+ </menu>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.read.access.in.working.set"
+ label="%InWorkingSet.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/readAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReadAccessInWorkingSet">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.read.access.in.hierarchy"
+ label="%InHierarchy.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/readAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReadAccessInHierarchy">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.read.access.in.project"
+ label="%InProject.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/readAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReadAccessInProject">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.read.access.in.workspace"
+ label="%InWorkspace.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/readAccessSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReadAccessInWorkspace">
+ </action>
+ <menu
+ label="%declarationsSubMenu.label"
+ path="org.eclipse.search.menu/contextMenuActionsGroup"
+ id="declarationsSubMenu">
+ <separator
+ name="group1">
+ </separator>
+ </menu>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.declarations.in.working.set"
+ label="%InWorkingSet.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/declarationsSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.DeclarationsInWorkingSet">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.declarations.in.hierarchy"
+ label="%InHierarchy.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/declarationsSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.DeclarationsInHierarchy">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.declarations.in.project"
+ label="%InProject.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/declarationsSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.DeclarationsInProject">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.declarations.in.workspace"
+ label="%DeclarationsInWorkspace.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/declarationsSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.DeclarationsInWorkspace">
+ </action>
+ <menu
+ label="%referencesSubMenu.label"
+ path="org.eclipse.search.menu/contextMenuActionsGroup"
+ id="referencesSubMenu">
+ <separator
+ name="group1">
+ </separator>
+ </menu>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.references.in.working.set"
+ label="%InWorkingSet.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/referencesSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReferencesInWorkingSet">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.references.in.hierarchy"
+ label="%InHierarchy.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/referencesSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReferencesInHierarchy">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.references.in.project"
+ label="%InProject.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/referencesSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReferencesInProject">
+ </action>
+ <action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.search.references.in.workspace"
+ label="%ReferencesInWorkspace.label"
+ retarget="true"
+ menubarPath="org.eclipse.search.menu/referencesSubMenu/group1"
+ allowLabelUpdate="true"
+ id="org.rubypeople.rdt.ui.actions.ReferencesInWorkspace">
+ </action>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ui.actionSetPartAssociations">
+ <actionSetPartAssociation
+ targetID="org.rubypeople.rdt.ui.SearchActionSet">
+ <part
+ id="org.rubypeople.rdt.ui.ViewRubyResources">
+ </part>
+ <part
+ id="org.rubypeople.rdt.ui.TypeHierarchy">
+ </part>
+ <part
+ id="org.rubypeople.rdt.ui.EditorRubyFile">
+ </part>
+ <part
+ id="org.rubypeople.rdt.ui.ProjectsView">
+ </part>
+ <part
+ id="org.rubypeople.rdt.ui.TypesView">
+ </part>
+ <part
+ id="org.rubypeoplee.rdt.ui.MembersView">
+ </part>
+ <part
+ id="org.eclipse.search.SearchResultView">
+ </part>
+ </actionSetPartAssociation>
+ </extension>
+<!-- End Ruby contributions for Search view -->
+
+ <extension
point="org.eclipse.ui.editors.markerUpdaters">
<updater
markerType="org.rubypeople.rdt.debug.core.RubyBreakpointMarker"
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OccurrencesSearchMenuAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OccurrencesSearchMenuAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OccurrencesSearchMenuAction.java 2007-08-17 16:09:27 UTC (rev 3000)
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.internal.ui.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IPartService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
+import org.eclipse.ui.actions.RetargetAction;
+import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor;
+import org.rubypeople.rdt.internal.ui.search.SearchMessages;
+import org.rubypeople.rdt.ui.actions.IRubyEditorActionDefinitionIds;
+import org.rubypeople.rdt.ui.actions.RdtActionConstants;
+
+/**
+ * <p>
+ * This is required because of
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=79162
+ * and
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=137679
+ * </p>
+ */
+public class OccurrencesSearchMenuAction implements IWorkbenchWindowPulldownDelegate2 {
+
+ private static Action NO_ACTION_AVAILABLE= new Action(SearchMessages.group_occurrences_quickMenu_noEntriesAvailable) {
+ public boolean isEnabled() {
+ return false;
+ }
+ };
+
+ private Menu fMenu;
+
+ private IPartService fPartService;
+ private RetargetAction[] fRetargetActions;
+
+ /**
+ * {@inheritDoc}
+ */
+ public Menu getMenu(Menu parent) {
+ setMenu(new Menu(parent));
+ fillMenu(fMenu);
+ return fMenu;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Menu getMenu(Control parent) {
+ setMenu(new Menu(parent));
+ fillMenu(fMenu);
+ return fMenu;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose() {
+ setMenu(null);
+ disposeSubmenuActions();
+ }
+
+ private RetargetAction createSubmenuAction(IPartService partService, String actionID, String text, String actionDefinitionId) {
+ RetargetAction action= new RetargetAction(actionID, text);
+ action.setActionDefinitionId(actionDefinitionId);
+
+ partService.addPartListener(action);
+ IWorkbenchPart activePart = partService.getActivePart();
+ if (activePart != null) {
+ action.partActivated(activePart);
+ }
+ return action;
+ }
+
+ private void disposeSubmenuActions() {
+ if (fPartService != null && fRetargetActions != null) {
+ for (int i= 0; i < fRetargetActions.length; i++) {
+ fPartService.removePartListener(fRetargetActions[i]);
+ fRetargetActions[i].dispose();
+ }
+ }
+ fRetargetActions= null;
+ fPartService= null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void init(IWorkbenchWindow window) {
+ disposeSubmenuActions(); // paranoia code: double initialization should not happen
+ if (window != null) {
+ fPartService= window.getPartService();
+ if (fPartService != null) {
+ fRetargetActions= new RetargetAction[] {
+ createSubmenuAction(fPartService, RdtActionConstants.FIND_OCCURRENCES_IN_FILE, SearchMessages.Search_FindOccurrencesInFile_shortLabel, IRubyEditorActionDefinitionIds.SEARCH_OCCURRENCES_IN_FILE)
+ };
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(IAction action) {
+ RubyEditor editor= null;
+ IWorkbenchPart activePart= RubyPlugin.getActivePage().getActivePart();
+ if (activePart instanceof RubyEditor)
+ editor= (RubyEditor) activePart;
+
+ (new RDTQuickMenuAction(editor, IRubyEditorActionDefinitionIds.SEARCH_OCCURRENCES_IN_FILE_QUICK_MENU) {
+ protected void fillMenu(IMenuManager menu) {
+ fillQuickMenu(menu);
+ }
+ }).run();
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ private void fillQuickMenu(IMenuManager manager) {
+ IAction[] actions= fRetargetActions;
+ if (actions != null) {
+ boolean hasAction= false;
+ for (int i= 0; i < actions.length; i++) {
+ IAction action= actions[i];
+ if (action.isEnabled()) {
+ hasAction= true;
+ manager.add(action);
+ }
+ }
+ if (!hasAction) {
+ manager.add(NO_ACTION_AVAILABLE);
+ }
+ } else {
+ manager.add(NO_ACTION_AVAILABLE);
+ }
+ }
+
+ /**
+ * The menu to show in the workbench menu
+ */
+ private void fillMenu(Menu menu) {
+ if (fRetargetActions != null) {
+ for (int i= 0; i < fRetargetActions.length; i++) {
+ ActionContributionItem item= new ActionContributionItem(fRetargetActions[i]);
+ item.fill(menu, -1);
+ }
+ } else {
+ // can only happen if 'init' was not called: programming error
+ ActionContributionItem item= new ActionContributionItem(NO_ACTION_AVAILABLE);
+ item.fill(menu, -1);
+ }
+ }
+
+ private void setMenu(Menu menu) {
+ if (fMenu != null) {
+ fMenu.dispose();
+ }
+ fMenu = menu;
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/OccurrencesSearchMenuAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/RDTQuickMenuAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/RDTQuickMenuAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/RDTQuickMenuAction.java 2007-08-17 16:09:27 UTC (rev 3000)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.internal.ui.actions;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.internal.ide.actions.QuickMenuAction;
+import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor;
+import org.rubypeople.rdt.internal.ui.text.RubyWordFinder;
+
+
+public abstract class RDTQuickMenuAction extends QuickMenuAction {
+
+ private RubyEditor fEditor;
+
+ public RDTQuickMenuAction(String commandId) {
+ super(commandId);
+ }
+
+ public RDTQuickMenuAction(RubyEditor editor, String commandId) {
+ super(commandId);
+ fEditor= editor;
+ }
+
+ protected Point computeMenuLocation(StyledText text) {
+ if (fEditor == null || text != fEditor.getViewer().getTextWidget())
+ return null;
+ return computeWordStart();
+ }
+
+ private Point computeWordStart() {
+ ITextSelection selection= (ITextSelection)fEditor.getSelectionProvider().getSelection();
+ IRegion textRegion= RubyWordFinder.findWord(fEditor.getViewer().getDocument(), selection.getOffset());
+ if (textRegion == null)
+ return null;
+
+ IRegion widgetRegion= modelRange2WidgetRange(textRegion);
+ if (widgetRegion == null)
+ return null;
+
+ int start= widgetRegion.getOffset();
+
+ StyledText styledText= fEditor.getViewer().getTextWidget();
+ Point result= styledText.getLocationAtOffset(start);
+ result.y+= styledText.getLineHeight(start);
+
+ if (!styledText.getClientArea().contains(result))
+ return null;
+ return result;
+ }
+
+ private IRegion modelRange2WidgetRange(IRegion region) {
+ ISourceViewer viewer= fEditor.getViewer();
+ if (viewer instanceof ITextViewerExtension5) {
+ ITextViewerExtension5 extension= (ITextViewerExtension5)viewer;
+ return extension.modelRange2WidgetRange(region);
+ }
+
+ IRegion visibleRegion= viewer.getVisibleRegion();
+ int start= region.getOffset() - visibleRegion.getOffset();
+ int end= start + region.getLength();
+ if (end > visibleRegion.getLength())
+ end= visibleRegion.getLength();
+
+ return new Region(start, end - start);
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/RDTQuickMenuAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OpenRubySearchPageAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OpenRubySearchPageAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OpenRubySearchPageAction.java 2007-08-17 16:09:27 UTC (rev 3000)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.internal.ui.search;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.rubypeople.rdt.internal.ui.RubyPlugin;
+
+/**
+ * Opens the Search Dialog and brings the Ruby search page to front
+ */
+public class OpenRubySearchPageAction implements IWorkbenchWindowActionDelegate {
+
+ private static final String RUBY_SEARCH_PAGE_ID= "org.rubypeople.rdt.ui.RubySearchPage"; //$NON-NLS-1$
+
+ private IWorkbenchWindow fWindow;
+
+ public OpenRubySearchPageAction() {
+ }
+
+ public void init(IWorkbenchWindow window) {
+ fWindow= window;
+ }
+
+ public void run(IAction action) {
+ if (fWindow == null || fWindow.getActivePage() == null) {
+ beep();
+ RubyPlugin.logErrorMessage("Could not open the search dialog - for some reason the window handle was null"); //$NON-NLS-1$
+ return;
+ }
+ NewSearchUI.openSearchDialog(fWindow, RUBY_SEARCH_PAGE_ID);
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ // do nothing since the action isn't selection dependent.
+ }
+
+ public void dispose() {
+ fWindow= null;
+ }
+
+ protected void beep() {
+ Shell shell= RubyPlugin.getActiveWorkbenchShell();
+ if (shell != null && shell.getDisplay() != null)
+ shell.getDisplay().beep();
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OpenRubySearchPageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.java 2007-08-17 15:44:05 UTC (rev 2999)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.java 2007-08-17 16:09:27 UTC (rev 3000)
@@ -133,6 +133,7 @@
public static String group_occurrences;
public static String group_declarations;
public static String group_writeReferences;
+ public static String group_occurrences_quickMenu_noEntriesAvailable;
public static String RubyElementAction_operationUnavailable_title;
public static String RubyElementAction_operationUnavailable_generic;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.properties 2007-08-17 15:44:05 UTC (rev 2999)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/SearchMessages.properties 2007-08-17 16:09:27 UTC (rev 3000)
@@ -84,6 +84,7 @@
group_readReferences= &Read Access
group_writeReferences= &Write Access
group_occurrences= Occurre&nces in File
+group_occurrences_quickMenu_noEntriesAvailable= <no entries available>
RubyElementAction_operationUnavailable_title= Operation Unavailable
RubyElementAction_operationUnavailable_generic= The operation is unavailable on the current selection. Please select a valid Ruby element name.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 15:44:06
|
Revision: 2999
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2999&view=rev
Author: cawilliams
Date: 2007-08-17 08:44:05 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
fix indentation of next line after quick fix for missing respond_to? definition
Modified Paths:
--------------
trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java
Modified: trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java
===================================================================
--- trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java 2007-08-17 15:38:37 UTC (rev 2998)
+++ trunk/com.aptana.rdt.ui/src/com/aptana/rdt/internal/ui/text/correction/QuickFixProcessor.java 2007-08-17 15:44:05 UTC (rev 2999)
@@ -99,8 +99,8 @@
Map options = script.getRubyProject().getOptions(true);
String indent = Indents.extractIndentString(line, options);
text = indent + text;
- text = text.replaceAll("\\n", "\n" + indent);
text = text + "\n";
+ text = text.replaceAll("\\n", "\n" + indent);
LocalCorrectionsSubProcessor.addReplacementProposal(offset, 0, text, "Add respond_to? method stub", proposals);
break;
default:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-08-17 15:38:42
|
Revision: 2998
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2998&view=rev
Author: cawilliams
Date: 2007-08-17 08:38:37 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
move out common utility code and expose it
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceElementParser.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceElementParser.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceElementParser.java 2007-08-17 15:38:07 UTC (rev 2997)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceElementParser.java 2007-08-17 15:38:37 UTC (rev 2998)
@@ -78,7 +78,6 @@
public class SourceElementParser extends InOrderVisitor {
private static final String MODULE_FUNCTION = "module_function";
- private static final String EMPTY_STRING = "";
private static final String PROTECTED = "protected";
private static final String PRIVATE = "private";
private static final String PUBLIC = "public";
@@ -88,7 +87,6 @@
private static final String ALIAS = "alias :";
private static final String MODULE = "Module";
private static final String CONSTRUCTOR_NAME = "initialize";
- private static final String NAMESPACE_DELIMETER = "::";
private static final String OBJECT = "Object";
private List<Visibility> visibilities = new ArrayList<Visibility>();
@@ -117,12 +115,12 @@
pushVisibility(Visibility.PUBLIC);
TypeInfo typeInfo = new TypeInfo();
- typeInfo.name = getFullyQualifiedName(iVisited.getCPath());
+ typeInfo.name = ASTUtil.getFullyQualifiedName(iVisited.getCPath());
typeInfo.declarationStart = iVisited.getPosition().getStartOffset();
typeInfo.nameSourceStart = iVisited.getCPath().getPosition().getStartOffset();
typeInfo.nameSourceEnd = iVisited.getCPath().getPosition().getEndOffset() - 1;
if (!typeInfo.name.equals(OBJECT)) {
- String superClass = getSuperClassName(iVisited.getSuperNode());
+ String superClass = ASTUtil.getSuperClassName(iVisited.getSuperNode());
typeInfo.superclass = superClass;
}
typeInfo.isModule = false;
@@ -147,7 +145,7 @@
public Instruction visitModuleNode(ModuleNode iVisited) {
pushVisibility(Visibility.PUBLIC);
TypeInfo typeInfo = new TypeInfo();
- typeInfo.name = getFullyQualifiedName(iVisited.getCPath());
+ typeInfo.name = ASTUtil.getFullyQualifiedName(iVisited.getCPath());
typeInfo.declarationStart = iVisited.getPosition().getStartOffset();
typeInfo.nameSourceStart = iVisited.getCPath().getPosition().getStartOffset();
typeInfo.nameSourceEnd = iVisited.getCPath().getPosition().getEndOffset() - 1;
@@ -245,37 +243,7 @@
private void popVisibility() {
visibilities.remove(visibilities.size() - 1);
}
-
- private String getFullyQualifiedName(Node node) {
- if (node == null)
- return EMPTY_STRING;
- if (node instanceof ConstNode) {
- ConstNode constNode = (ConstNode) node;
- return constNode.getName();
- }
- if (node instanceof Colon2Node) {
- Colon2Node colonNode = (Colon2Node) node;
- String prefix = getFullyQualifiedName(colonNode.getLeftNode());
- if (prefix.length() > 0)
- prefix = prefix + NAMESPACE_DELIMETER;
- return prefix + colonNode.getName();
- }
- return EMPTY_STRING;
- }
- /**
- * Build up the fully qualified name of the super class for a class
- * declaration
- *
- * @param superNode
- * @return
- */
- private String getSuperClassName(Node superNode) {
- if (superNode == null)
- return OBJECT;
- return getFullyQualifiedName(superNode);
- }
-
@Override
public Instruction visitConstDeclNode(ConstDeclNode iVisited) {
FieldInfo field = createFieldInfo(iVisited);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-08-17 15:38:07 UTC (rev 2997)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-08-17 15:38:37 UTC (rev 2998)
@@ -47,6 +47,10 @@
public abstract class ASTUtil {
private static final boolean VERBOSE = false;
+ private static final String NAMESPACE_DELIMETER = "::";
+ private static final String OBJECT = "Object";
+ private static final String EMPTY_STRING = "";
+
/**
* @param argsNode
* @param bodyNode
@@ -265,4 +269,34 @@
return arguments;
}
+ /**
+ * Build up the fully qualified name of the super class for a class
+ * declaration
+ *
+ * @param superNode
+ * @return
+ */
+ public static String getSuperClassName(Node superNode) {
+ if (superNode == null)
+ return OBJECT;
+ return getFullyQualifiedName(superNode);
+ }
+
+ public static String getFullyQualifiedName(Node node) {
+ if (node == null)
+ return EMPTY_STRING;
+ if (node instanceof ConstNode) {
+ ConstNode constNode = (ConstNode) node;
+ return constNode.getName();
+ }
+ if (node instanceof Colon2Node) {
+ Colon2Node colonNode = (Colon2Node) node;
+ String prefix = getFullyQualifiedName(colonNode.getLeftNode());
+ if (prefix.length() > 0)
+ prefix = prefix + NAMESPACE_DELIMETER;
+ return prefix + colonNode.getName();
+ }
+ return EMPTY_STRING;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|