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-09-12 16:09:18
|
Revision: 3147
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3147&view=rev
Author: cawilliams
Date: 2007-09-12 09:08:13 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
insert new Ruby Explorer view in place of Ruby Resources View
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RdtPerspectiveFactory.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/packageview/PackageExplorerPart.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/IPackagesViewPart.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RdtPerspectiveFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RdtPerspectiveFactory.java 2007-09-12 15:15:27 UTC (rev 3146)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RdtPerspectiveFactory.java 2007-09-12 16:08:13 UTC (rev 3147)
@@ -1,6 +1,7 @@
package org.rubypeople.rdt.internal.ui;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.search.ui.NewSearchUI;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
@@ -16,40 +17,51 @@
}
public void createInitialLayout(IPageLayout layout) {
- String existingEditorArea = layout.getEditorArea();
+ String editorArea = layout.getEditorArea();
- IFolderLayout rubyResourcesArea = layout.createFolder("rubyResourcesArea", IPageLayout.LEFT, (float) 0.26, existingEditorArea);
- rubyResourcesArea.addView(IRubyConstants.RUBY_RESOURCES_VIEW_ID);
- rubyResourcesArea.addPlaceholder(IPageLayout.ID_RES_NAV);
+ IFolderLayout folder = layout.createFolder("left", IPageLayout.LEFT, (float) 0.26, editorArea);//$NON-NLS-1$
+ folder.addView(RubyUI.ID_RUBY_EXPLORER);
+ folder.addView(RubyUI.ID_TYPE_HIERARCHY);
+ folder.addPlaceholder(IPageLayout.ID_RES_NAV);
- IFolderLayout consoleArea = layout.createFolder("consoleArea", IPageLayout.BOTTOM, (float) 0.65, existingEditorArea);
+ IFolderLayout consoleArea = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.65, editorArea);//$NON-NLS-1$
consoleArea.addView(IPageLayout.ID_PROBLEM_VIEW);
- consoleArea.addView(IRubyConstants.RI_VIEW_ID);
+ consoleArea.addView(IPageLayout.ID_TASK_LIST);
+ consoleArea.addPlaceholder(IRubyConstants.RI_VIEW_ID);
+ consoleArea.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID);
consoleArea.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
- consoleArea.addView(IPageLayout.ID_TASK_LIST);
+ consoleArea.addPlaceholder(IPageLayout.ID_BOOKMARKS);
consoleArea.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
- IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, (float) 0.5, "rubyResourcesArea");
- bottomLeft.addView(IPageLayout.ID_OUTLINE);
+ layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float)0.75, editorArea);
layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
layout.addActionSet(RubyUI.ID_ACTION_SET);
layout.addActionSet(RubyUI.ID_ELEMENT_CREATION_ACTION_SET);
layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
+ // views - ruby
+ layout.addShowViewShortcut(RubyUI.ID_RUBY_EXPLORER);
+ layout.addShowViewShortcut(RubyUI.ID_TYPE_HIERARCHY);
+
+ // views - search
+ layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID);
+
// views - debugging
layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
-
+
// views - standard workbench
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
-
+ layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
+ layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
+
// new actions - Ruby project creation wizard
- layout.addNewWizardShortcut(IRubyConstants.ID_NEW_CLASS_WIZARD);
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
+ layout.addNewWizardShortcut(IRubyConstants.ID_NEW_CLASS_WIZARD); //$NON-NLS-1$
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
+ layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/packageview/PackageExplorerPart.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/packageview/PackageExplorerPart.java 2007-09-12 15:15:27 UTC (rev 3146)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/packageview/PackageExplorerPart.java 2007-09-12 16:08:13 UTC (rev 3147)
@@ -162,7 +162,7 @@
private static final int HIERARCHICAL_LAYOUT= 0x1;
private static final int FLAT_LAYOUT= 0x2;
- public final static String VIEW_ID= RubyUI.ID_PACKAGES;
+ public final static String VIEW_ID= RubyUI.ID_RUBY_EXPLORER;
// Persistance tags.
static final String TAG_SELECTION= "selection"; //$NON-NLS-1$
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/IPackagesViewPart.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/IPackagesViewPart.java 2007-09-12 15:15:27 UTC (rev 3146)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/IPackagesViewPart.java 2007-09-12 16:08:13 UTC (rev 3147)
@@ -22,7 +22,7 @@
* This interface is not intended to be implemented by clients.
* </p>
*
- * @see RubyUI#ID_PACKAGES
+ * @see RubyUI#ID_RUBY_EXPLORER
*/
public interface IPackagesViewPart extends IViewPart {
/**
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-09-12 15:15:27 UTC (rev 3146)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-09-12 16:08:13 UTC (rev 3147)
@@ -149,7 +149,7 @@
* @see org.eclipse.ui.IWorkbenchPage#findView(java.lang.String)
* @see org.eclipse.ui.IWorkbenchPage#showView(java.lang.String)
*/
- public static final String ID_PACKAGES= "org.rubypeople.rdt.ui.PackageExplorer"; //$NON-NLS-1$
+ public static final String ID_RUBY_EXPLORER= "org.rubypeople.rdt.ui.PackageExplorer"; //$NON-NLS-1$
/**
* Returns the Ruby element wrapped by the given editor input.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 15:15:34
|
Revision: 3146
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3146&view=rev
Author: cawilliams
Date: 2007-09-12 08:15:27 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/com.aptana.rdt.tests/bin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 15:15:11
|
Revision: 3145
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3145&view=rev
Author: cawilliams
Date: 2007-09-12 08:15:09 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/org.epic.regexp/bin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 15:15:02
|
Revision: 3144
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3144&view=rev
Author: cawilliams
Date: 2007-09-12 08:15:00 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/org.rubypeople.rdt.astviewer/bin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 15:14:36
|
Revision: 3143
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3143&view=rev
Author: cawilliams
Date: 2007-09-12 08:14:34 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/bin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 15:14:29
|
Revision: 3142
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3142&view=rev
Author: cawilliams
Date: 2007-09-12 08:14:27 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring.tests/bin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 15:13:57
|
Revision: 3141
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3141&view=rev
Author: cawilliams
Date: 2007-09-12 08:13:53 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/com.aptana.rdt/bin/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-12 14:32:06
|
Revision: 3140
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3140&view=rev
Author: cawilliams
Date: 2007-09-12 07:32:02 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
when doing code completions for method calls, only include all methods starting with user's prefix if our type inferrencing is unsure of type - no guesses (Object) or multiple guesses.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-09-11 20:04:25 UTC (rev 3139)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-09-12 14:32:02 UTC (rev 3140)
@@ -157,7 +157,10 @@
}
list.addAll(mapAll.values());
}
- list.addAll(suggestAllMethodsMatchingPrefix(script)); // FIXME Only do this if we have no suggestions? Have a minimum length threshold?
+ // Only search for all methods matching prefix if we're unsure of type (multiple guesses, or none)
+ if (guesses.size() > 1 || (guesses.size() == 1 && guesses.get(0).getType().equals(OBJECT))) {
+ list.addAll(suggestAllMethodsMatchingPrefix(script));
+ }
Collections.sort(list, new CompletionProposalComparator());
for (CompletionProposal proposal : list) {
fRequestor.accept(proposal);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 20:04:38
|
Revision: 3139
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3139&view=rev
Author: cawilliams
Date: 2007-09-11 13:04:25 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
Modified: trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-09-11 19:11:07 UTC (rev 3138)
+++ trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-09-11 20:04:25 UTC (rev 3139)
@@ -32,8 +32,10 @@
org.rubypeople.rdt.internal.ui.wizards.dialogfields,
org.rubypeople.rdt.ui,
org.rubypeople.rdt.ui.actions,
+ org.rubypeople.rdt.ui.dialogs,
org.rubypeople.rdt.ui.extensions,
org.rubypeople.rdt.ui.rubyeditor,
+ org.rubypeople.rdt.ui.search,
org.rubypeople.rdt.ui.text,
org.rubypeople.rdt.ui.text.correction,
org.rubypeople.rdt.ui.text.folding,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 19:11:22
|
Revision: 3138
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3138&view=rev
Author: cawilliams
Date: 2007-09-11 12:11:07 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
Modified: trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-09-11 16:11:51 UTC (rev 3137)
+++ trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-09-11 19:11:07 UTC (rev 3138)
@@ -15,6 +15,7 @@
org.rubypeople.rdt.internal.ui.compare,
org.rubypeople.rdt.internal.ui.dialogs,
org.rubypeople.rdt.internal.ui.infoviews,
+ org.rubypeople.rdt.internal.ui.packageview,
org.rubypeople.rdt.internal.ui.preferences,
org.rubypeople.rdt.internal.ui.preferences.formatter,
org.rubypeople.rdt.internal.ui.resourcesview,
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java 2007-09-11 16:11:51 UTC (rev 3137)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/SelectionConverter.java 2007-09-11 19:11:07 UTC (rev 3138)
@@ -16,6 +16,8 @@
import org.rubypeople.rdt.core.ICodeAssist;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.core.ISourceRange;
+import org.rubypeople.rdt.core.ISourceReference;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.corext.util.RubyModelUtil;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
@@ -185,4 +187,37 @@
return result;
}
+ public static IRubyElement resolveEnclosingElement(RubyEditor editor, ITextSelection selection) throws RubyModelException {
+ return resolveEnclosingElement(getInput(editor), selection);
+ }
+
+ public static IRubyElement resolveEnclosingElement(IRubyElement input, ITextSelection selection) throws RubyModelException {
+ IRubyElement atOffset= null;
+ if (input instanceof IRubyScript) {
+ IRubyScript cunit= (IRubyScript)input;
+ RubyModelUtil.reconcile(cunit);
+ atOffset= cunit.getElementAt(selection.getOffset());
+ } else {
+ return null;
+ }
+ if (atOffset == null) {
+ return input;
+ } else {
+ int selectionEnd= selection.getOffset() + selection.getLength();
+ IRubyElement result= atOffset;
+ if (atOffset instanceof ISourceReference) {
+ ISourceRange range= ((ISourceReference)atOffset).getSourceRange();
+ while (range.getOffset() + range.getLength() < selectionEnd) {
+ result= result.getParent();
+ if (! (result instanceof ISourceReference)) {
+ result= input;
+ break;
+ }
+ range= ((ISourceReference)result).getSourceRange();
+ }
+ }
+ return result;
+ }
+ }
+
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java 2007-09-11 16:11:51 UTC (rev 3137)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/EditorUtility.java 2007-09-11 19:11:07 UTC (rev 3138)
@@ -47,6 +47,15 @@
public class EditorUtility {
/**
+ * Opens a Ruby editor for an element such as <code>IRubyElement</code>, <code>IFile</code>, or <code>IStorage</code>.
+ * The editor is activated by default.
+ * @return the IEditorPart or null if wrong element type or opening failed
+ */
+ public static IEditorPart openInEditor(Object inputElement) throws RubyModelException, PartInitException {
+ return openInEditor(inputElement, true);
+ }
+
+ /**
* Opens a Ruby editor for an element (IRubyElement, IFile, IStorage...)
* @return the IEditorPart or null if wrong element type or opening failed
*/
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java 2007-09-11 16:11:51 UTC (rev 3137)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java 2007-09-11 19:11:07 UTC (rev 3138)
@@ -9,12 +9,11 @@
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner;
import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-import org.rubypeople.rdt.internal.ui.RubyUIMessages;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.internal.ui.RubyUIMessages;
import org.rubypeople.rdt.internal.ui.text.IRubyPartitions;
import org.rubypeople.rdt.ui.text.RubyTextTools;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-09-11 16:11:51 UTC (rev 3137)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-09-11 19:11:07 UTC (rev 3138)
@@ -15,6 +15,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.rubypeople.rdt.core.IRubyElement;
@@ -299,4 +300,19 @@
dialog.setFilter(filter);
return dialog;
}
+
+ /**
+ * Opens a Ruby editor on the given Ruby element. The element can be a ruby script.
+ * If there already is an open Ruby editor for the given element, it is returned.
+ *
+ * @param element the input element; a ruby script
+ * (<code>IRubyScript</code>)
+ * @return the editor, or </code>null</code> if wrong element type or opening failed
+ * @exception PartInitException if the editor could not be initialized
+ * @exception RubyModelException if this element does not exist or if an
+ * exception occurs while accessing its underlying resource
+ */
+ public static IEditorPart openInEditor(IRubyElement element) throws RubyModelException, PartInitException {
+ return EditorUtility.openInEditor(element);
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 16:11:57
|
Revision: 3137
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3137&view=rev
Author: cawilliams
Date: 2007-09-11 09:11:51 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
show breakpoint marker annotations on external files
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalFileRubyAnnotationModel.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalFileRubyAnnotationModel.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalFileRubyAnnotationModel.java 2007-09-11 15:42:26 UTC (rev 3136)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalFileRubyAnnotationModel.java 2007-09-11 16:11:51 UTC (rev 3137)
@@ -1,29 +1,74 @@
package org.rubypeople.rdt.internal.ui.rubyeditor;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
+import org.rubypeople.rdt.core.IRubyScript;
+import org.rubypeople.rdt.internal.core.ExternalRubyScript;
public class ExternalFileRubyAnnotationModel extends AbstractMarkerAnnotationModel {
- protected void deleteMarkers(IMarker[] markers) throws CoreException {
- // TODO Auto-generated method stub
+ private IWorkspace fWorkspace;
+ private IRubyScript fScript;
+ public ExternalFileRubyAnnotationModel(IRubyScript script) {
+ fScript = script;
+ fWorkspace= ResourcesPlugin.getWorkspace();
}
+
+ protected void deleteMarkers(final IMarker[] markers) throws CoreException {
+ fWorkspace.run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ for (int i= 0; i < markers.length; ++i) {
+ markers[i].delete();
+ }
+ }
+ }, null, IWorkspace.AVOID_UPDATE, null);
+ }
protected boolean isAcceptable(IMarker marker) {
- // TODO Auto-generated method stub
- return false;
+ return marker != null && marker.getResource().equals(getResource()) && getFileName(marker).equals(getFileName());
}
+ private String getFileName(IMarker marker) {
+ return marker.getAttribute("externalFileName", ""); // FIXME This is duplicated in RubyLineBreakpoint. Move this to an interface as a constant!
+ }
+
protected void listenToMarkerChanges(boolean listen) {
// TODO Auto-generated method stub
}
protected IMarker[] retrieveMarkers() throws CoreException {
- // TODO Auto-generated method stub
- return null;
+ IMarker[] markers = getResource().findMarkers(IMarker.MARKER, true, IResource.DEPTH_INFINITE);
+ List<IMarker> filtered = new ArrayList<IMarker>();
+ for (int i = 0; i < markers.length; i++) {
+ if (getFileName(markers[i]).equals(getFileName())) {
+ filtered.add(markers[i]);
+ }
+ }
+ return filtered.toArray(new IMarker[filtered.size()]);
}
+ private String getFileName() {
+ if (fScript == null) return null;
+ if (fScript instanceof ExternalRubyScript) {
+ ExternalRubyScript script = (ExternalRubyScript) fScript;
+ return script.getFile().getAbsolutePath();
+ }
+ return fScript.getPath().toPortableString();
+ }
+
+ private IResource getResource() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java 2007-09-11 15:42:26 UTC (rev 3136)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyDocumentProvider.java 2007-09-11 16:11:51 UTC (rev 3137)
@@ -54,7 +54,7 @@
}
protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
- return new ExternalFileRubyAnnotationModel();
+ return new ExternalFileRubyAnnotationModel(null);
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java 2007-09-11 15:42:26 UTC (rev 3136)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyScriptDocumentProvider.java 2007-09-11 16:11:51 UTC (rev 3137)
@@ -183,26 +183,14 @@
/**
* Creates an annotation model derived from the given class file editor input.
*
- * @param classFileEditorInput the editor input from which to query the annotations
+ * @param rubyScriptEditorInput the editor input from which to query the annotations
* @return the created annotation model
* @exception CoreException if the editor input could not be accessed
*/
- protected IAnnotationModel createRubyScriptAnnotationModel(IRubyScriptEditorInput classFileEditorInput) throws CoreException {
-// IResource resource= null;
-// IRubyScript classFile= classFileEditorInput.getRubyScript();
-//
-// IResourceLocator locator= (IResourceLocator) classFile.getAdapter(IResourceLocator.class);
-// if (locator != null)
-// resource= locator.getContainingResource(classFile);
-//
-// if (resource != null) {
-// RubyScriptMarkerAnnotationModel model= new RubyScriptMarkerAnnotationModel(resource);
-// model.setRubyScript(classFile);
-// return model;
-// }
-//
-// return null;
- return new ExternalFileRubyAnnotationModel();
+ protected IAnnotationModel createRubyScriptAnnotationModel(IRubyScriptEditorInput rubyScriptEditorInput) throws CoreException {
+ IRubyScript script = rubyScriptEditorInput.getRubyScript();
+ ExternalFileRubyAnnotationModel model = new ExternalFileRubyAnnotationModel(script);
+ return model;
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 15:42:32
|
Revision: 3136
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3136&view=rev
Author: cawilliams
Date: 2007-09-11 08:42:26 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
minor change in how OccurrencesFinder job is run
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-09-11 15:42:13 UTC (rev 3135)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-09-11 15:42:26 UTC (rev 3136)
@@ -1500,10 +1500,9 @@
// Mark occurrences
fOccurrencesFinderJob= new OccurrencesFinderJob(document, positions, selection);
- //fOccurrencesFinderJob.setPriority(Job.DECORATE);
- //fOccurrencesFinderJob.setSystem(true);
- //fOccurrencesFinderJob.schedule();
- fOccurrencesFinderJob.run(new NullProgressMonitor());
+ fOccurrencesFinderJob.setPriority(Job.DECORATE);
+ fOccurrencesFinderJob.setSystem(true);
+ fOccurrencesFinderJob.schedule();
}
protected void setMarkOccurrencePreferences(IOccurrencesFinder occurrencesFinder)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 15:42:15
|
Revision: 3135
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3135&view=rev
Author: cawilliams
Date: 2007-09-11 08:42:13 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
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-09-11 15:39:03 UTC (rev 3134)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesFinder.java 2007-09-11 15:42:13 UTC (rev 3135)
@@ -701,10 +701,7 @@
// TODO refactor the getting-of-name
String name = null;
- if (node instanceof ArgumentNode) {
- ArgumentNode argNode = (ArgumentNode) node;
- name = argNode.getName();
- } else if (node instanceof ReturnNode) {
+ if (node instanceof ReturnNode) {
return node.getPosition();
} else if (isLocalVarRef(node) || isDVarRef(node) || isInstanceVarRef(node) || isGlobalVarRef(node) || isClassVarRef(node) || isConstRef(node) || node instanceof BlockArgNode) {
name = ASTUtil.getNameReflectively(node);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 15:39:07
|
Revision: 3134
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3134&view=rev
Author: cawilliams
Date: 2007-09-11 08:39:03 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
show file name properly for external breakpoints in breakpoint listing
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/DebugModelPresentation.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/DebugModelPresentation.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/DebugModelPresentation.java 2007-09-11 14:18:38 UTC (rev 3133)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/DebugModelPresentation.java 2007-09-11 15:39:03 UTC (rev 3134)
@@ -29,7 +29,7 @@
if (item instanceof RubyLineBreakpoint) {
RubyLineBreakpoint breakpoint = (RubyLineBreakpoint) item;
try {
- return breakpoint.getMarker().getResource().getName() + ":" + breakpoint.getLineNumber();
+ return breakpoint.getFileName() + ":" + breakpoint.getLineNumber();
} catch (CoreException e) {
DebugUIPlugin.log(e) ;
return "--";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 14:18:40
|
Revision: 3133
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3133&view=rev
Author: cawilliams
Date: 2007-09-11 07:18:38 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
be able to grab the rest arg node if it is the closest node
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java 2007-09-11 13:58:28 UTC (rev 3132)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java 2007-09-11 14:18:38 UTC (rev 3133)
@@ -86,6 +86,10 @@
if (!((locatedNode instanceof Colon2Node) && (iVisited instanceof ConstNode))) {
locatedNode = iVisited;
}
+ if (iVisited instanceof ArgsNode) {
+ ArgsNode args = (ArgsNode) iVisited;
+ handleNode(args.getRestArgNode());
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 13:58:29
|
Revision: 3132
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3132&view=rev
Author: cawilliams
Date: 2007-09-11 06:58:28 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
fix #5911 - Mark occurrences doesn't mark rest args in method signature
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/ScopedNodeLocator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/ScopedNodeLocator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/ScopedNodeLocator.java 2007-09-11 13:58:21 UTC (rev 3131)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/ScopedNodeLocator.java 2007-09-11 13:58:28 UTC (rev 3132)
@@ -8,6 +8,7 @@
import org.jruby.ast.ArgumentNode;
import org.jruby.ast.Node;
import org.jruby.evaluator.Instruction;
+import org.jruby.lexer.yacc.ISourcePosition;
/**
* Visitor to find all nodes within a specific scope adhering to a certain condition.
@@ -78,6 +79,15 @@
}
}
+ ArgumentNode argNode = iVisited.getRestArgNode();
+ if (argNode != null) {
+ if (acceptor.doesAccept(argNode)) {
+ ISourcePosition pos = argNode.getPosition();
+ pos.adjustStartOffset(1); // Rest args are off by one...
+ argNode.setPosition(pos);
+ locatedNodes.add(argNode);
+ }
+ }
return super.visitArgsNode(iVisited);
//
// handleNode(iVisited);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 13:58:22
|
Revision: 3131
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3131&view=rev
Author: cawilliams
Date: 2007-09-11 06:58:21 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
fix #5911 - Mark occurrences doesn't mark rest args in method signature
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-09-11 13:42:31 UTC (rev 3130)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesFinder.java 2007-09-11 13:58:21 UTC (rev 3131)
@@ -701,7 +701,10 @@
// TODO refactor the getting-of-name
String name = null;
- if (node instanceof ReturnNode) {
+ if (node instanceof ArgumentNode) {
+ ArgumentNode argNode = (ArgumentNode) node;
+ name = argNode.getName();
+ } else if (node instanceof ReturnNode) {
return node.getPosition();
} else if (isLocalVarRef(node) || isDVarRef(node) || isInstanceVarRef(node) || isGlobalVarRef(node) || isClassVarRef(node) || isConstRef(node) || node instanceof BlockArgNode) {
name = ASTUtil.getNameReflectively(node);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 13:42:32
|
Revision: 3130
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3130&view=rev
Author: cawilliams
Date: 2007-09-11 06:42:31 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
wrap startup of some code to hopefully get the plugin to at least start in Eclipse 3.3
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java 2007-09-11 13:40:57 UTC (rev 3129)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java 2007-09-11 13:42:31 UTC (rev 3130)
@@ -69,7 +69,11 @@
ActionFilterAdapterFactory actionFilterAdapterFactory= new ActionFilterAdapterFactory();
manager.registerAdapters(actionFilterAdapterFactory, RubyVariable.class);
new CodeReloader();
- EvaluationContextManager.startup();
+ try {
+ EvaluationContextManager.startup();
+ } catch (Exception e) {
+ log(e);
+ }
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 13:40:59
|
Revision: 3129
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3129&view=rev
Author: cawilliams
Date: 2007-09-11 06:40:57 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
fix some translation strings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties 2007-09-11 13:28:33 UTC (rev 3128)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties 2007-09-11 13:40:57 UTC (rev 3129)
@@ -125,9 +125,6 @@
RubyElementLabels_declseparator_string=\ :\
RubyElementLabels_import_container=require/load declarations
-HistoryListAction_remove=&Remove
-HistoryListAction_remove_all=Remove &All
-HistoryListAction_max_entries_constraint=Please enter a positive integer smaller than {0}.
OpenTypeHierarchyUtil_error_open_view=Problems opening Type Hierarchy View
OpenTypeHierarchyUtil_error_open_perspective=Problems opening Type Hierarchy Perspective
OpenTypeHierarchyUtil_error_open_editor=Problems opening Ruby Editor
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties 2007-09-11 13:28:33 UTC (rev 3128)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties 2007-09-11 13:40:57 UTC (rev 3129)
@@ -67,10 +67,10 @@
OpenTypeHierarchyAction_description=Open a type hierarchy on the selected element
OpenTypeHierarchyAction_dialog_title=Open Type Hierarchy
OpenTypeHierarchyAction_messages_title=Cannot create type hierarchy
-OpenTypeHierarchyAction_messages_no_java_element=A Ruby element must be selected.
-OpenTypeHierarchyAction_messages_no_java_resources=The selected package does not contain any Ruby resource.
+OpenTypeHierarchyAction_messages_no_ruby_element=A Ruby element must be selected.
+OpenTypeHierarchyAction_messages_no_ruby_resources=The selected package does not contain any Ruby resource.
OpenTypeHierarchyAction_messages_no_types=The selected compilation unit does not contain a type.
-OpenTypeHierarchyAction_messages_no_valid_java_element=A valid Ruby element must be selected.
+OpenTypeHierarchyAction_messages_no_valid_ruby_element=A valid Ruby element must be selected.
OpenTypeHierarchyAction_messages_unknown_import_decl=The selected import declaration can not be resolved.
OpenTypeInHierarchyAction_label=Open Type in Hierarchy...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 13:28:35
|
Revision: 3128
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3128&view=rev
Author: cawilliams
Date: 2007-09-11 06:28:33 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
clean up code a little
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-09-11 12:56:10 UTC (rev 3127)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-09-11 13:28:33 UTC (rev 3128)
@@ -358,7 +358,7 @@
protected void doSetInput(IEditorInput input) throws CoreException {
// HACK Ugly code here in the beginning to handle Eclipse 3.2 and 3.3 opening external files. We wrap them into our own external ruby editor..
IPath path = null;
- if (input.getClass().getName().equals("org.eclipse.ui.internal.editors.text.JavaFileEditorInput")) { // Eclipse 3.2 uses this editor input for external files...
+ if (externalFileOpenedInEclipse32(input)) { // Eclipse 3.2 uses this editor input for external files...
try {
Method method = input.getClass().getDeclaredMethod("getPath", new Class[0]);
if (method != null) {
@@ -380,12 +380,12 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- } else if (input.getClass().getName().equals("org.eclipse.ui.ide.FileStoreEditorInput")) { // Eclipse 3.3 uses this editor input for external files...
+ } else if (externalFileOpenedInEclipse33(input)) { // Eclipse 3.3 uses this editor input for external files...
try {
Method method = input.getClass().getDeclaredMethod("getURI", new Class[0]);
if (method != null) {
URI uri = (URI) method.invoke(input, new Object[0]);
- if (uri != null) {
+ if (uri != null && uri.getScheme().equals("file")) {
path = new Path(uri.getPath());
}
}
@@ -406,13 +406,14 @@
e.printStackTrace();
}
}
- if (path != null && (input.getClass().getName().equals("org.eclipse.ui.internal.editors.text.JavaFileEditorInput") || input.getClass().getName().equals("org.eclipse.ui.ide.FileStoreEditorInput"))) {
+ if (path != null && (externalFileOpenedInEclipse32(input) || externalFileOpenedInEclipse33(input))) {
IProject[] projects = RubyCore.getRubyProjects();
- if (projects != null && projects.length > 0) {
+ if (projects != null && projects.length > 0) { // search for the file in one of the ruby projects loadpaths
IRubyProject proj = RubyCore.create(projects[0]);
ISourceFolderRoot root = proj.getSourceFolderRoot(path.removeLastSegments(1).toPortableString());
ISourceFolder folder = root.getSourceFolder("");
IRubyScript script = folder.getRubyScript(path.lastSegment());
+ // FIXME Check to see if it exists?
input = new RubyScriptEditorInput((ExternalRubyScript) script);
}
}
@@ -425,6 +426,14 @@
setOutlinePageInput(fOutlinePage, input);
}
+ private boolean externalFileOpenedInEclipse33(IEditorInput input) {
+ return input.getClass().getName().equals("org.eclipse.ui.ide.FileStoreEditorInput");
+ }
+
+ private boolean externalFileOpenedInEclipse32(IEditorInput input) {
+ return input.getClass().getName().equals("org.eclipse.ui.internal.editors.text.JavaFileEditorInput");
+ }
+
protected void setOutlinePageInput(RubyOutlinePage page, IEditorInput input) {
if (page == null)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-11 12:56:17
|
Revision: 3127
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3127&view=rev
Author: cawilliams
Date: 2007-09-11 05:56:10 -0700 (Tue, 11 Sep 2007)
Log Message:
-----------
partial fix for #5910 - RDT incompatible with Eclipse 3.3.
try to make opening an external ruby file work in both 3.2 and 3.3 by using reflection
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-09-10 20:29:23 UTC (rev 3126)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-09-11 12:56:10 UTC (rev 3127)
@@ -1,5 +1,8 @@
package org.rubypeople.rdt.internal.ui.rubyeditor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -9,9 +12,11 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
@@ -65,7 +70,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.ui.internal.editors.text.JavaFileEditorInput;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
import org.eclipse.ui.texteditor.IDocumentProvider;
@@ -351,15 +355,64 @@
*
* @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
*/
- protected void doSetInput(IEditorInput input) throws CoreException {
- if (input instanceof JavaFileEditorInput) {
- JavaFileEditorInput duh = (JavaFileEditorInput) input;
+ protected void doSetInput(IEditorInput input) throws CoreException {
+ // HACK Ugly code here in the beginning to handle Eclipse 3.2 and 3.3 opening external files. We wrap them into our own external ruby editor..
+ IPath path = null;
+ if (input.getClass().getName().equals("org.eclipse.ui.internal.editors.text.JavaFileEditorInput")) { // Eclipse 3.2 uses this editor input for external files...
+ try {
+ Method method = input.getClass().getDeclaredMethod("getPath", new Class[0]);
+ if (method != null) {
+ path = (IPath) method.invoke(input, new Object[0]);
+ }
+ } catch (SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else if (input.getClass().getName().equals("org.eclipse.ui.ide.FileStoreEditorInput")) { // Eclipse 3.3 uses this editor input for external files...
+ try {
+ Method method = input.getClass().getDeclaredMethod("getURI", new Class[0]);
+ if (method != null) {
+ URI uri = (URI) method.invoke(input, new Object[0]);
+ if (uri != null) {
+ path = new Path(uri.getPath());
+ }
+ }
+ } catch (SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (path != null && (input.getClass().getName().equals("org.eclipse.ui.internal.editors.text.JavaFileEditorInput") || input.getClass().getName().equals("org.eclipse.ui.ide.FileStoreEditorInput"))) {
IProject[] projects = RubyCore.getRubyProjects();
if (projects != null && projects.length > 0) {
IRubyProject proj = RubyCore.create(projects[0]);
- ISourceFolderRoot root = proj.getSourceFolderRoot(duh.getPath().removeLastSegments(1).toPortableString());
+ ISourceFolderRoot root = proj.getSourceFolderRoot(path.removeLastSegments(1).toPortableString());
ISourceFolder folder = root.getSourceFolder("");
- IRubyScript script = folder.getRubyScript(duh.getPath().lastSegment());
+ IRubyScript script = folder.getRubyScript(path.lastSegment());
input = new RubyScriptEditorInput((ExternalRubyScript) script);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-10 20:33:55
|
Revision: 3125
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3125&view=rev
Author: cawilliams
Date: 2007-09-10 13:29:19 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
add ability to set breakpoints on external libraries (like Rails). Still need to show external filename for breakpoint in listing, and show icon in ruler for external ruby script editor.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java 2007-09-10 18:40:55 UTC (rev 3124)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/debug/core/RubyLineBreakpoint.java 2007-09-10 20:29:19 UTC (rev 3125)
@@ -14,18 +14,24 @@
public class RubyLineBreakpoint extends LineBreakpoint {
public static final String RUBY_BREAKPOINT_MARKER = "org.rubypeople.rdt.debug.core.rubyLineBreakpointMarker"; //$NON-NLS-1$
+ private static final String EXTERNAL_FILENAME = "externalFileName";
private int index = -1 ; // index of breakpoint on ruby debugger side
public RubyLineBreakpoint() {
}
public RubyLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException {
+ this(resource, lineNumber, resource.getName());
+ }
+
+ public RubyLineBreakpoint(final IResource resource, final int lineNumber, final String fileName) throws CoreException {
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
setMarker(resource.createMarker(RUBY_BREAKPOINT_MARKER));
getMarker().setAttribute(IMarker.LINE_NUMBER, lineNumber + 1);
getMarker().setAttribute(IBreakpoint.ID, getModelIdentifier());
getMarker().setAttribute(REGISTERED, false);
+ getMarker().setAttribute(EXTERNAL_FILENAME, fileName);
// setEnabled must be set before calling setRegistered
setEnabled(true);
setRegistered(true);
@@ -40,7 +46,11 @@
}
public String getFileName() throws CoreException {
- return ensureMarker().getResource().getName();
+ IResource resource = ensureMarker().getResource();
+ if (resource.equals(ResourcesPlugin.getWorkspace().getRoot())) {
+ return ensureMarker().getAttribute(EXTERNAL_FILENAME, "");
+ }
+ return resource.getName();
}
public int getLineNumber() throws CoreException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-10 20:33:55
|
Revision: 3126
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3126&view=rev
Author: cawilliams
Date: 2007-09-10 13:29:23 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
add ability to set breakpoints on external libraries (like Rails). Still need to show external filename for breakpoint in listing, and show icon in ruler for external ruby script editor.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ManageBreakpointRulerAction.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ManageBreakpointRulerAction.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ManageBreakpointRulerAction.java 2007-09-10 20:29:19 UTC (rev 3125)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/actions/ManageBreakpointRulerAction.java 2007-09-10 20:29:23 UTC (rev 3126)
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
@@ -29,6 +30,7 @@
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.IUpdate;
import org.rubypeople.rdt.debug.core.RubyLineBreakpoint;
+import org.rubypeople.rdt.internal.ui.rubyeditor.IRubyScriptEditorInput;
/**
*
@@ -87,8 +89,9 @@
if (model == null) { return breakpoints; }
try {
IResource resource = getResource();
+ if (resource == null) resource = ResourcesPlugin.getWorkspace().getRoot();
if (resource == null) return breakpoints;
- IMarker[] markers = resource.findMarkers("org.rubypeople.rdt.debug.core.RubyBreakpointMarker", // IBreakpoint.BREAKPOINT_MARKER,
+ IMarker[] markers = resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER,
false, IResource.DEPTH_INFINITE);
IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
@@ -185,12 +188,29 @@
getDocument();
int rulerLine = getVerticalRulerInfo().getLineOfLastMouseButtonActivity();
try {
- RubyLineBreakpoint bp = new RubyLineBreakpoint(((IFileEditorInput) editorInput).getFile(), rulerLine);
+ IResource resource = getResource(editorInput);
+ if (resource.equals(ResourcesPlugin.getWorkspace().getRoot())) {
+ RubyLineBreakpoint bp = new RubyLineBreakpoint(resource, rulerLine, getFileName(editorInput));
+ } else {
+ RubyLineBreakpoint bp = new RubyLineBreakpoint(resource, rulerLine);
+ }
} catch (CoreException x) {
System.out.println(x.getMessage());
}
}
+ private String getFileName(IEditorInput editorInput) {
+ if (editorInput instanceof IRubyScriptEditorInput)
+ return ((IRubyScriptEditorInput) editorInput).getRubyScript().getPath().makeAbsolute().toOSString();
+ return null;
+ }
+
+ private IResource getResource(IEditorInput editorInput) {
+ if (editorInput instanceof IFileEditorInput)
+ return ((IFileEditorInput) editorInput).getFile();
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
protected void removeMarkers(List markers) {
Iterator breakpointIt = fMarkers.iterator();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-10 18:40:56
|
Revision: 3124
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3124&view=rev
Author: cawilliams
Date: 2007-09-10 11:40:55 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
fix resolution of some constants (modules who are referred to by their simple name and we must deduce the fully qualified name)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.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/codeassist/SelectionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-09-10 18:29:05 UTC (rev 3123)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/SelectionEngine.java 2007-09-10 18:40:55 UTC (rev 3124)
@@ -155,7 +155,7 @@
RubyElementRequestor completer = new RubyElementRequestor(script);
IType[] types = completer.findType(name);
if (types != null && types.length > 0) return types;
- String fullyQualifiedName = getFullyQualifiedName(root, name);
+ String fullyQualifiedName = getFullyQualifiedName(root, constNode.getPosition().getStartOffset(), name);
if (fullyQualifiedName == null) return new IRubyElement[0];
return completer.findType(fullyQualifiedName); // get fully qualified name of surrounding type!
}
@@ -222,31 +222,12 @@
return new IRubyElement[0];
}
- private String getFullyQualifiedName(Node root, String name) {
- List<Node> surrounding = ScopedNodeLocator.Instance().findNodesInScope(root, new INodeAcceptor() {
-
- public boolean doesAccept(Node node) {
- return node instanceof ModuleNode || node instanceof ClassNode;
- }
-
- });
- // drop last class/module
- if (surrounding.size() < 2) return null;
- surrounding.remove(surrounding.size() - 1);
- StringBuffer buffer = new StringBuffer();
- boolean first = true;
- for (Node node : surrounding) {
- if (!first) {
- buffer.append("::");
- }
- buffer.append(ASTUtil.getNameReflectively(node));
- if (first) {
- first = false;
- }
+ private String getFullyQualifiedName(Node root, int offset, String name) {
+ String namespace = ASTUtil.getNamespace(root, offset);
+ if (namespace == null || namespace.trim().length() == 0) {
+ return name;
}
- buffer.append("::");
- buffer.append(name);
- return buffer.toString();
+ return namespace + "::" + name;
}
private List<SearchMatch> search(int type, String patternString, int limitTo, int matchRule) throws CoreException {
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-09-10 18:29:05 UTC (rev 3123)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-09-10 18:40:55 UTC (rev 3124)
@@ -43,6 +43,8 @@
import org.jruby.ast.types.INameNode;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.parser.StaticScope;
+import org.rubypeople.rdt.internal.ti.util.ClosestSpanningNodeLocator;
+import org.rubypeople.rdt.internal.ti.util.INodeAcceptor;
public abstract class ASTUtil {
private static final boolean VERBOSE = false;
@@ -299,4 +301,40 @@
return EMPTY_STRING;
}
+ public static String getNamespace(Node root, int offset) {
+ List<Node> surrounding = new ArrayList<Node>();
+ Node typeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(root, offset, new INodeAcceptor() {
+
+ public boolean doesAccept(Node node) {
+ return node instanceof ModuleNode || node instanceof ClassNode;
+ }
+
+ });
+ while (typeNode != null) {
+ surrounding.add(0, typeNode);
+ typeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(root, typeNode.getPosition().getStartOffset() - 1, new INodeAcceptor() {
+
+ public boolean doesAccept(Node node) {
+ return node instanceof ModuleNode || node instanceof ClassNode;
+ }
+
+ });
+ }
+ // drop last class/module
+ if (surrounding.size() < 2) return "";
+ surrounding.remove(surrounding.size() - 1);
+ StringBuffer buffer = new StringBuffer();
+ boolean first = true;
+ for (Node node : surrounding) {
+ if (!first) {
+ buffer.append("::");
+ }
+ buffer.append(getNameReflectively(node));
+ if (first) {
+ first = false;
+ }
+ }
+ return buffer.toString();
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-09-10 18:29:11
|
Revision: 3123
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3123&view=rev
Author: cawilliams
Date: 2007-09-10 11:29:05 -0700 (Mon, 10 Sep 2007)
Log Message:
-----------
apparently available() is returning 1 every time we read the gzipped gem index, we we're reading 1 byte at a time.
Modify behavior to try and read into 4K buffer instead of 1b buffer.
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-09-10 17:22:13 UTC (rev 3122)
+++ trunk/com.aptana.rdt/src/com/aptana/rdt/internal/core/gems/GemManager.java 2007-09-10 18:29:05 UTC (rev 3123)
@@ -262,8 +262,7 @@
URLConnection con = url.openConnection();
content = new InflaterInputStream((InputStream) con.getContent());
while (true) {
- int bytesToRead = content.available();
- byte[] tmp = new byte[bytesToRead];
+ byte[] tmp = new byte[4096];
int length = content.read(tmp);
if (length == -1)
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|