Permalink
Browse files

Merge branch 'master' of git://github.com/JPMoresmau/eclipsefp

  • Loading branch information...
2 parents ce2df95 + bbe20df commit 20b865086dcf1ccb770656a078d647bcd35597a3 @clanehin clanehin committed May 11, 2011
Showing with 307 additions and 99 deletions.
  1. +1 −1 docs/releasenotes/net.sf.eclipsefp.haskell_2.0.4.txt
  2. +48 −0 docs/releasenotes/net.sf.eclipsefp.haskell_2.0.5.txt
  3. +2 −2 net.sf.eclipsefp.haskell-feature/feature.xml
  4. +6 −4 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/util/ResourceUtil.java
  5. +1 −1 net.sf.eclipsefp.haskell.debug.core/META-INF/MANIFEST.MF
  6. +10 −4 ...g.core/src/net/sf/eclipsefp/haskell/debug/core/internal/launch/AbstractHaskellLaunchDelegate.java
  7. +18 −0 ...core/src/net/sf/eclipsefp/haskell/debug/core/internal/launch/ExecutableHaskellLaunchDelegate.java
  8. +1 −1 net.sf.eclipsefp.haskell.haddock/META-INF/MANIFEST.MF
  9. +6 −1 net.sf.eclipsefp.haskell.haddock/src/net/sf/eclipsefp/haskell/haddock/ui/wizard/op/GenerateDocs.java
  10. BIN net.sf.eclipsefp.haskell.scion.client/src/net/sf/eclipsefp/haskell/scion/client/scion-0.1.0.10.zip
  11. +1 −1 ....haskell.scion.client/src/net/sf/eclipsefp/haskell/scion/internal/commands/TokenTypesCommand.java
  12. +2 −1 ...lipsefp.haskell.scion.client/src/net/sf/eclipsefp/haskell/scion/internal/servers/ScionServer.java
  13. +4 −0 net.sf.eclipsefp.haskell.scion.client/src/net/sf/eclipsefp/haskell/scion/types/GhcMessages.java
  14. +3 −2 ...ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/haskell/HaskellSourceViewerConfiguration.java
  15. +32 −0 ...p.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/haskell/text/ScionTokenScanner.java
  16. +7 −8 ...clipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/editor/AppearancePP.java
  17. +1 −1 ...c/net/sf/eclipsefp/haskell/ui/internal/preferences/editor/DefaultEditorPreferenceInitializer.java
  18. +1 −1 ...askell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/editor/IEditorPreferenceNames.java
  19. +7 −9 ...sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/editor/TypingPP.java
  20. +69 −0 ...f.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/resolve/AddPackageDependency.java
  21. +40 −23 ...p.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/resolve/BuildMarkerResolutionGenerator.java
  22. +2 −1 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/scion/ScionManager.java
  23. +4 −0 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/util/UITexts.java
  24. +4 −0 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/util/uitexts.properties
  25. +3 −3 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/properties/ImportLibrariesPP.java
  26. +31 −32 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/util/text/WordFinder.java
  27. +1 −1 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/wizards/cabal/CabalInstallWizard.java
  28. +1 −1 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/wizards/cabal/CabalSDistWizard.java
  29. +1 −1 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/wizards/cabal/CabalTestWizard.java
@@ -17,7 +17,7 @@ Scion from source (git clone git://github.com/JPMoresmau/scion.git, runhaskell
Setup.hs configure/build/install)
Fixes:
- - do not auto detected files starting with cabal that do not report a version number
+ - do not auto detect files starting with cabal that do not report a version number
Features:
- GHC 7.0 support: scion now builds with GHC 7
@@ -0,0 +1,48 @@
+EclipseFP Haskell 2.0.5
+
+Release Notes
+
+
+Scion:
+
+ EclipseFP relies on Scion, the Haskell IDE library, for a lot of its
+functionality. See http://code.google.com/p/scion-lib/ for more information.
+
+ You cannot use the version from Hackage since commands have been
+added for eclipsefp. From version 1.111, eclipsefp includes a modified source
+distribution of scion, that is built and used by eclipsefp if the use built-in
+server preferences option is checked. Since it is by default, eclipse might be
+a bit slow to start the first time scion is built. Otherwise, you can build
+Scion from source (git clone git://github.com/JPMoresmau/scion.git, runhaskell
+Setup.hs configure/build/install)
+
+Fixes:
+- Cabal preferences mismatch error is now a warning, and preferences synchronize automatically with current versions
+- bug-reports cabal field now properly highlighted
+- only accept valid project names in project creation wizard
+- clean cabal automatically when GHC complains of a missing -package-id
+- Latex literate style supported by syntax highlighter
+- {-# #-} pragmas now marked properly as comments in syntax highlighter
+- files containing tabs instead of space: a warning is raised when opening to give the option of converting tabs to space,
+ since in most cases with GHC7 the editor will crash on opening. Option to disable "spaces for tabs" in preferences removed. You can't have tabs, full stop.
+- on unix, an error "getFileStatus: does not exist" could happen
+
+Features:
+- Quick Fix: add missing dependency on hidden package
+- run cabal update before building scion
+- Wizard on projects (cabal source export, install, test, haddock export) will ask the user to save files if there are unsaved files in the project
+
+Internal:
+
+Upgrade notes:
+ - If you had EclipseFP configured with a previous version of GHC and Cabal, run autodetect again in the Haskell Implementations and Scion and Cabal preference pages.
+
+Known issues:
+
+
+
+Thanks to B. Scott Michel (bscottm@ieee.org) and Alejandro Serrano for their contributions.
+Thanks to all bug reporters and users for their feedback.
+Thanks to all the people that expressed interest in EclipseFP and want to see it stay alive and improve!
+
+JP Moresmau (jp@moresmau.fr)
@@ -96,7 +96,7 @@ and is also available at http://github.com/JPMoresmau/scion/raw/master/docs/LICE
id="net.sf.eclipsefp.haskell.haddock"
download-size="0"
install-size="0"
- version="2.0.3"
+ version="2.0.5"
unpack="false"/>
<plugin
@@ -124,7 +124,7 @@ and is also available at http://github.com/JPMoresmau/scion/raw/master/docs/LICE
id="net.sf.eclipsefp.haskell.debug.core"
download-size="0"
install-size="0"
- version="2.0.4"
+ version="2.0.5"
unpack="false"/>
<plugin
@@ -331,10 +331,12 @@ public static IContainer getSourceContainer( final IResource resource ) {
Collection<String> hidden=new HashSet<String>();
if (ips.size()>0){
Map<String,CabalPackage[]> pkgs=ScionPlugin.getScionInstance( files[0] ).getPackagesByDB();
- for (CabalPackage[] cps:pkgs.values()){
- for (CabalPackage cp:cps){
- if (cp.getComponents().length>0 && ips.contains(cp.getName()) && !cp.isExposed()){
- hidden.add(cp.getName());
+ if (pkgs!=null){
+ for (CabalPackage[] cps:pkgs.values()){
+ for (CabalPackage cp:cps){
+ if (cp.getComponents().length>0 && ips.contains(cp.getName()) && !cp.isExposed()){
+ hidden.add(cp.getName());
+ }
}
}
}
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.debug.core;singleton:=true
-Bundle-Version: 2.0.4
+Bundle-Version: 2.0.5
Bundle-Activator: net.sf.eclipsefp.haskell.debug.core.internal.HaskellDebugCore
Bundle-Vendor: %bundleVendor
Require-Bundle: org.eclipse.core.runtime,
@@ -8,6 +8,7 @@
import net.sf.eclipsefp.haskell.debug.core.internal.HaskellDebugCore;
import net.sf.eclipsefp.haskell.debug.core.internal.util.CoreTexts;
import net.sf.eclipsefp.haskell.util.NetworkUtil;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -20,13 +21,13 @@
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
-public abstract class AbstractHaskellLaunchDelegate implements ILaunchConfigurationDelegate{
+public abstract class AbstractHaskellLaunchDelegate extends LaunchConfigurationDelegate{
public void launch( final ILaunchConfiguration configuration,
final String mode, final ILaunch launch, final IProgressMonitor monitor )
@@ -207,17 +208,22 @@ private LaunchCancelledException() {
}
}
- public static void runInConsole(final List<String> commands,final File directory,final String title,final boolean needsHTTP_PROXY) throws CoreException{
+ public static void runInConsole(final IProject prj,final List<String> commands,final File directory,final String title,final boolean needsHTTP_PROXY) throws CoreException{
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
String configTypeId = ExecutableHaskellLaunchDelegate.class.getName();
ILaunchConfigurationType configType = launchManager.getLaunchConfigurationType( configTypeId );
final ILaunchConfigurationWorkingCopy wc=configType.newInstance( null, title );//launchManager.generateUniqueLaunchConfigurationNameFrom( title));
- wc.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true );
+ // if private, we don't get the save dialog for unsave files in project
+ wc.setAttribute( IDebugUIConstants.ATTR_PRIVATE, prj==null );
wc.setAttribute( IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false );
wc.setAttribute( IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true );
+ if (prj!=null){
+ wc.setAttribute(ILaunchAttributes.PROJECT_NAME,prj.getName());
+ }
+
wc.setAttribute(ILaunchAttributes.EXECUTABLE,commands.get( 0 ));
if (directory!=null){
wc.setAttribute(ILaunchAttributes.WORKING_DIRECTORY,directory.getAbsolutePath());
@@ -1,5 +1,8 @@
package net.sf.eclipsefp.haskell.debug.core.internal.launch;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.IProcess;
@@ -18,4 +21,19 @@ protected void postProcessCreation( final ILaunchConfiguration configuration,
// NOOP
}
+
+ @Override
+ protected IProject[] getBuildOrder( final ILaunchConfiguration configuration,
+ final String mode ) throws CoreException {
+ // indicate the project is to be looked at for unsaved files
+ String prj=configuration.getAttribute( ILaunchAttributes.PROJECT_NAME, (String)null );
+ if (prj!=null){
+ IProject p=ResourcesPlugin.getWorkspace().getRoot().getProject( prj );
+ if (p!=null){
+ return new IProject[]{p};
+ }
+ }
+ return super.getBuildOrder( configuration, mode );
+ }
+
}
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.haddock;singleton:=true
-Bundle-Version: 2.0.3
+Bundle-Version: 2.0.5
Bundle-Activator: net.sf.eclipsefp.haskell.haddock.HaddockPlugin
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
@@ -9,6 +9,7 @@
import net.sf.eclipsefp.haskell.debug.core.internal.launch.HaskellLaunchDelegate;
import net.sf.eclipsefp.haskell.haddock.HaddockPlugin;
import net.sf.eclipsefp.haskell.haddock.core.HaddockInfo;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
/** <p>the operation that performs the actual Haddock run.</p>
@@ -45,7 +46,11 @@ public boolean run() {
proc.setAttribute( IProcess.ATTR_PROCESS_TYPE, PROCESS_TYPE_ID );
getLauchManager().addLaunch( newLaunch );*/
String label = "Generating Haddock docs";
- AbstractHaskellLaunchDelegate.runInConsole( Arrays.asList(cmdLine), null, label,false );
+ IProject prj=null;
+ if (info.getProjects().length==1){
+ prj=info.getProjects()[0];
+ }
+ AbstractHaskellLaunchDelegate.runInConsole(prj, Arrays.asList(cmdLine), null, label,false );
} catch( CoreException cex ) {
HaddockPlugin.log( "Problem during docs generation", cex );
@@ -70,8 +70,8 @@ protected void doProcessResult() throws JSONException {
// }
// }
// }
- tokens.add(td);
// previous=td;
+ tokens.add(td);
}
} else {
JSONObject err=o.optJSONObject("Left");
@@ -519,7 +519,7 @@ public void run() {
if ( lastQueue != null && commands.equals(lastQueue) ) {
if (stallCount > MAXSTALLS) {
- StringBuffer diagMsg = new StringBuffer();
+ StringBuilder diagMsg = new StringBuilder();
diagMsg.append("Possibly stalled queue [").append(serverName).append("], depth = ");
diagMsg.append(lastDepth).append(PlatformUtil.NL);
@@ -531,6 +531,7 @@ public void run() {
}
ScionPlugin.logInfo(diagMsg.toString());
+ stallCount=0;
}
} else {
// Only re-assign as needed
@@ -26,5 +26,9 @@
public static String ERROR_INTERACTIVE_DISABLED="interactive check disabled"; //$NON-NLS-1$
+ public static String MISSING_MODULE="could not find module";//$NON-NLS-1$
+ public static String MISSING_MODULE_ADD_START="perhaps you need to add `";//$NON-NLS-1$
+ public static String MISSING_MODULE_ADD_END="' to the build-depends"; //$NON-NLS-1$
+
}
@@ -259,8 +259,9 @@ private IPreferenceStore getPreferenceStore() {
}
private boolean isSpacesForTabs() {
- String key = IEditorPreferenceNames.EDITOR_SPACES_FOR_TABS;
- return getPreferenceStore().getBoolean( key );
+ //String key = IEditorPreferenceNames.EDITOR_SPACES_FOR_TABS;
+ //return getPreferenceStore().getBoolean( key );
+ return true; // too problematic otherwise
}
// private boolean isLatexLiterate() {
@@ -13,12 +13,19 @@
import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
import net.sf.eclipsefp.haskell.ui.internal.preferences.editor.IEditorPreferenceNames;
import net.sf.eclipsefp.haskell.ui.internal.preferences.editor.SyntaxPreviewer;
+import net.sf.eclipsefp.haskell.ui.internal.util.UITexts;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+import org.eclipse.ui.texteditor.IDocumentProvider;
import org.json.JSONArray;
/**
@@ -44,6 +51,8 @@
private int offset;
private int length;
+ private boolean checkedTabs=false;
+
private final Map<String,IToken> tokenByTypes;
public ScionTokenScanner(final ScannerManager man,final ScionInstance instance,final IFile file){
@@ -138,6 +147,29 @@ public void setRange( final IDocument document, final int offset, final int leng
if( !document.equals( doc ) || !newContents.equals( contents ) || lTokenDefs == null ) {
doc = document;
contents = newContents;
+ if (!checkedTabs){
+ checkedTabs=true;
+ if (contents.contains( "\t" )){
+
+ if (MessageDialog.openConfirm( Display.getCurrent().getActiveShell() , UITexts.error_tabs , UITexts.error_tabs_message )){
+ try {
+ IDocumentProvider prov=new TextFileDocumentProvider();
+ prov.connect(file);
+ IDocument doc2=prov.getDocument( file );
+ int tw=HaskellUIPlugin.getDefault().getPreferenceStore().getInt( EDITOR_TAB_WIDTH );
+ StringBuilder sb=new StringBuilder();
+ for (int a=0;a<tw;a++){
+ sb.append(" ");
+ }
+ contents=contents.replace( "\t",sb.toString() );
+ doc2.set(contents);
+ prov.saveDocument( new NullProgressMonitor(), file, doc2, true );
+ } catch (CoreException ce){
+ HaskellUIPlugin.log( ce );
+ }
+ }
+ }
+ }
lTokenDefs = instance.tokenTypes( file, contents );
}
} else {
@@ -1,6 +1,5 @@
package net.sf.eclipsefp.haskell.ui.internal.preferences.editor;
-import net.sf.eclipsefp.common.ui.dialog.DialogField;
import net.sf.eclipsefp.common.ui.preferences.overlay.OverlayPreferenceStore;
import net.sf.eclipsefp.common.ui.util.DialogUtil;
import net.sf.eclipsefp.haskell.ui.internal.util.UITexts;
@@ -38,7 +37,7 @@
private List colorList;
private ColorSelector colorSelector;
- private DialogField spaceForTabs;
+ // private DialogField spaceForTabs;
@Override
public void init( final IWorkbench workbench ) {
@@ -59,7 +58,7 @@ protected void addPreferences( final OverlayPreferenceStore store ) {
// store.addBooleanKey( EDITOR_OVERVIEW_RULER );
// store.addStringKey( EDITOR_LINE_NUMBER_RULER_COLOR );
// store.addBooleanKey( EDITOR_LINE_NUMBER_RULER );
- store.addBooleanKey( EDITOR_SPACES_FOR_TABS );
+// store.addBooleanKey( EDITOR_SPACES_FOR_TABS );
store.addIntKey( EDITOR_TAB_WIDTH );
store.addIntKey( EDITOR_CABAL_TAB_WIDTH );
}
@@ -89,9 +88,9 @@ public void widgetSelected(final SelectionEvent e) {
gd.horizontalSpan=2;
link.setLayoutData( gd );
- String prefName = IEditorPreferenceNames.EDITOR_SPACES_FOR_TABS;
- spaceForTabs=createBooleanField( control, UITexts.preferences_editor_typing_spaces_tabs, prefName );
- new Label(control,SWT.NONE);
+// String prefName = IEditorPreferenceNames.EDITOR_SPACES_FOR_TABS;
+// spaceForTabs=createBooleanField( control, UITexts.preferences_editor_typing_spaces_tabs, prefName );
+ // new Label(control,SWT.NONE);
tab.addIntegerField( control, UITexts.preferences_editor_typing_tab_width, IEditorPreferenceNames.EDITOR_TAB_WIDTH, 3, 0 );
tab.addIntegerField( control, UITexts.preferences_editor_typing_cabal_tab_width, IEditorPreferenceNames.EDITOR_CABAL_TAB_WIDTH, 3, 0 );
@@ -214,9 +213,9 @@ public void run() {
}
}
} );
- if (spaceForTabs!=null){
+ /*if (spaceForTabs!=null){
spaceForTabs.setInfo( getFromStore( IEditorPreferenceNames.EDITOR_SPACES_FOR_TABS ) );
- }
+ }*/
}
// helping methods
@@ -72,7 +72,7 @@ private static void initTyping( final IPreferenceStore store ) {
store.setDefault( EDITOR_TAB_WIDTH, 8 );
store.setDefault( EDITOR_CABAL_TAB_WIDTH, 2 );
// good practice, no?
- store.setDefault( EDITOR_SPACES_FOR_TABS, true );
+ //store.setDefault( EDITOR_SPACES_FOR_TABS, true );
store.setDefault( EDITOR_CLOSE_STRINGS, true );
store.setDefault( EDITOR_CLOSE_BRACKETS_AND_PARENS, true );
store.setDefault( EDITOR_CLOSE_BRACES, true );
@@ -68,7 +68,7 @@
String EDITOR_DEFAULT_COLOR = "defaultColor"; //$NON-NLS-1$
String EDITOR_DEFAULT_BOLD = "defaultBold"; //$NON-NLS-1$
- String EDITOR_SPACES_FOR_TABS = "spacesForTabs"; //$NON-NLS-1$
+// String EDITOR_SPACES_FOR_TABS = "spacesForTabs"; //$NON-NLS-1$
String EDITOR_CLOSE_STRINGS = "closeStrings"; //$NON-NLS-1$
String EDITOR_CLOSE_BRACKETS_AND_PARENS = "closeBracketsAndParens"; //$NON-NLS-1$
String EDITOR_CLOSE_BRACES = "closeBraces"; //$NON-NLS-1$
Oops, something went wrong.

0 comments on commit 20b8650

Please sign in to comment.