Skip to content
Browse files

Preferences pages for Alex, Happy, UUAGC

  • Loading branch information...
1 parent e4104c9 commit 08fa6c0440c4ab8ae1dea48d66249982deed928a @JPMoresmau committed
View
29 docs/releasenotes/net.sf.eclipsefp.haskell_2.3.3.txt
@@ -0,0 +1,29 @@
+EclipseFP Haskell 2.3.2
+
+Release Notes
+
+
+Necessary Haskell packages:
+
+ - EclipseFP relies on BuildWrapper, a Haskell IDE library, for a lot of its functionality. See https://github.com/JPMoresmau/BuildWrapper for more information. Version 0.6.2 of buildwrapper has been validated with this version of EclipseFP
+ - EclipseFP also uses scion-browser. Version 0.2.11 has been validated with this version of EclipseFP
+
+
+Fixes:
+
+
+Features:
+ - Evaluate GHCi expressions in debug mode even when not stopped at a breakpoint
+ - Can specify paths of executables in preferences for Alex, Happy and UUAGC
+
+Internal:
+
+
+Upgrade notes:
+ - Upgrade via the Eclipse install site http://eclipsefp.sf.net/updates.
+
+
+Known issues:
+
+Thanks to all bug reporters and users for their feedback, and specifically to Adam Foltzer for his contribution to scion-browser.
+Thanks to all the people that expressed interest in EclipseFP and want to see it stay alive and improve!
View
2 net.sf.eclipsefp.haskell.core/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
net.sf.eclipsefp.haskell.hlint;bundle-version="2.3.2",
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.2",
- net.sf.eclipsefp.haskell.buildwrapper;bundle-version="2.3.0"
+ net.sf.eclipsefp.haskell.buildwrapper;bundle-version="2.3.2"
Bundle-ActivationPolicy: lazy
Bundle-ManifestVersion: 2
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
View
52 ...lipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/runner/AlexRunner.java
@@ -1,22 +1,30 @@
-package net.sf.eclipsefp.haskell.core.partitioned.runner;
-
-import java.io.StringWriter;
-
-/**
- * Runner for Alex lexer tool.
- *
- * @author Alejandro Serrano
- */
-public class AlexRunner extends PartitionedRunner {
-
- @Override
- public String getExecutableName() {
- return "alex"; //$NON-NLS-1$
- }
-
- @Override
- public StringWriter selectStream( final StringWriter out, final StringWriter err ) {
- return out;
- }
-
-}
+package net.sf.eclipsefp.haskell.core.partitioned.runner;
+
+import java.io.StringWriter;
+
+/**
+ * Runner for Alex lexer tool.
+ *
+ * @author Alejandro Serrano
+ */
+public class AlexRunner extends PartitionedRunner {
+ private static String fullPath;
+
+ public static void setFullPath( final String path ) {
+ fullPath = path;
+ }
+
+ @Override
+ public String getExecutableName() {
+ if (fullPath!=null && fullPath.length()>0){
+ return fullPath;
+ }
+ return "alex"; //$NON-NLS-1$
+ }
+
+ @Override
+ public StringWriter selectStream( final StringWriter out, final StringWriter err ) {
+ return out;
+ }
+
+}
View
52 ...ipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/runner/HappyRunner.java
@@ -1,22 +1,30 @@
-package net.sf.eclipsefp.haskell.core.partitioned.runner;
-
-import java.io.StringWriter;
-
-/**
- * Runner for Happy parser tool.
- *
- * @author Alejandro Serrano
- */
-public class HappyRunner extends PartitionedRunner {
-
- @Override
- public String getExecutableName() {
- return "happy"; //$NON-NLS-1$
- }
-
- @Override
- public StringWriter selectStream( final StringWriter out, final StringWriter err ) {
- return out;
- }
-
-}
+package net.sf.eclipsefp.haskell.core.partitioned.runner;
+
+import java.io.StringWriter;
+
+/**
+ * Runner for Happy parser tool.
+ *
+ * @author Alejandro Serrano
+ */
+public class HappyRunner extends PartitionedRunner {
+ private static String fullPath;
+
+ public static void setFullPath( final String path ) {
+ fullPath = path;
+ }
+
+ @Override
+ public String getExecutableName() {
+ if (fullPath!=null && fullPath.length()>0){
+ return fullPath;
+ }
+ return "happy"; //$NON-NLS-1$
+ }
+
+ @Override
+ public StringWriter selectStream( final StringWriter out, final StringWriter err ) {
+ return out;
+ }
+
+}
View
161 ...ipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/runner/UuagcRunner.java
@@ -1,74 +1,87 @@
-package net.sf.eclipsefp.haskell.core.partitioned.runner;
-
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-import net.sf.eclipsefp.haskell.core.uuagc.UuagcFile;
-import net.sf.eclipsefp.haskell.core.uuagc.UuagcProjectManager;
-import net.sf.eclipsefp.haskell.util.ProcessRunner;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Runner for UU Attribute Grammar system.
- *
- * @author Alejandro Serrano
- */
-public class UuagcRunner {
-
- private final IProject project;
-
- public UuagcRunner( final IProject project ) {
- this.project = project;
- }
-
- public StringWriter selectStream( final StringWriter out,
- final StringWriter err ) {
- return out;
- }
-
- public String[] getExecutableAndArgs( final IResource resource ) {
- UuagcProjectManager mgr = new UuagcProjectManager( project );
- mgr.initFromProject();
- UuagcFile file = mgr.getElement( resource.getProjectRelativePath()
- .toPortableString() );
- if( file != null ) {
- ArrayList<String> r = new ArrayList<String>();
- r.add( "uuagc" ); //$NON-NLS-1$
- for( String option: file.getOptions() ) {
- if( option.indexOf( ' ' ) == -1 ) {
- r.add( "--" + option ); //$NON-NLS-1$
- } else {
- int spacePos = option.indexOf( ' ' );
- String initial = option.substring( 0, spacePos );
- String end = option.substring( spacePos + 1 );
- if( end.startsWith( "\"" ) ) { //$NON-NLS-1$
- // Remove quotes
- end = end.substring( 1, end.length() - 1 );
- }
- r.add( "--" + initial + "=" + end ); //$NON-NLS-1$//$NON-NLS-2$
- }
- }
- r.add( resource.getLocation().toOSString() );
- return r.toArray( new String[ r.size() ] );
- }
- // If no special information is found
- return new String[] { "uuagc", "--all", resource.getLocation().toOSString() }; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- public List<ProcessorError> run( final IResource resource ) {
- try {
- // Run the command
- StringWriter out = new StringWriter();
- StringWriter err = new StringWriter();
- IPath path = resource.getLocation();
- new ProcessRunner().executeBlocking( path.toFile().getParentFile(), out,
- err, getExecutableAndArgs( resource ) );
- // Parse the output
- return OutputParser.errors( selectStream( out, err ).toString() );
- } catch( Throwable ex ) {
- return new ArrayList<ProcessorError>();
- }
- }
-}
+package net.sf.eclipsefp.haskell.core.partitioned.runner;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import net.sf.eclipsefp.haskell.core.uuagc.UuagcFile;
+import net.sf.eclipsefp.haskell.core.uuagc.UuagcProjectManager;
+import net.sf.eclipsefp.haskell.util.ProcessRunner;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Runner for UU Attribute Grammar system.
+ *
+ * @author Alejandro Serrano
+ */
+public class UuagcRunner {
+
+ private final IProject project;
+
+ private static String fullPath;
+
+ public static void setFullPath( final String path ) {
+ fullPath = path;
+ }
+
+ public String getExecutableName() {
+ if (fullPath!=null && fullPath.length()>0){
+ return fullPath;
+ }
+ return "uuagc"; //$NON-NLS-1$
+ }
+
+ public UuagcRunner( final IProject project ) {
+ this.project = project;
+ }
+
+ public StringWriter selectStream( final StringWriter out,
+ final StringWriter err ) {
+ return out;
+ }
+
+ public String[] getExecutableAndArgs( final IResource resource ) {
+ UuagcProjectManager mgr = new UuagcProjectManager( project );
+ mgr.initFromProject();
+ UuagcFile file = mgr.getElement( resource.getProjectRelativePath()
+ .toPortableString() );
+ if( file != null ) {
+ ArrayList<String> r = new ArrayList<String>();
+ r.add( "uuagc" ); //$NON-NLS-1$
+ for( String option: file.getOptions() ) {
+ if( option.indexOf( ' ' ) == -1 ) {
+ r.add( "--" + option ); //$NON-NLS-1$
+ } else {
+ int spacePos = option.indexOf( ' ' );
+ String initial = option.substring( 0, spacePos );
+ String end = option.substring( spacePos + 1 );
+ if( end.startsWith( "\"" ) ) { //$NON-NLS-1$
+ // Remove quotes
+ end = end.substring( 1, end.length() - 1 );
+ }
+ r.add( "--" + initial + "=" + end ); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ }
+ r.add( resource.getLocation().toOSString() );
+ return r.toArray( new String[ r.size() ] );
+ }
+ // If no special information is found
+ return new String[] { getExecutableName(), "--all", resource.getLocation().toOSString() }; //$NON-NLS-1$
+ }
+
+ public List<ProcessorError> run( final IResource resource ) {
+ try {
+ // Run the command
+ StringWriter out = new StringWriter();
+ StringWriter err = new StringWriter();
+ IPath path = resource.getLocation();
+ new ProcessRunner().executeBlocking( path.toFile().getParentFile(), out,
+ err, getExecutableAndArgs( resource ) );
+ // Parse the output
+ return OutputParser.errors( selectStream( out, err ).toString() );
+ } catch( Throwable ex ) {
+ return new ArrayList<ProcessorError>();
+ }
+ }
+}
View
4 net.sf.eclipsefp.haskell.ui/plugin.properties
@@ -70,6 +70,10 @@ yesodPP_name= Yesod
snapPP_name= Snap
sourceGraphPP_name= SourceGraph
stylishHaskellPP_name= Stylish Haskell
+alexPP_name= Alex
+happyPP_name= Happy
+uuagcPP_name= UUAGC
+
implementationsPP_name = Haskell Implementations
#importLibsPP_name = Import Libraries
#projectImportLibsPP_name = Import Libraries
View
20 net.sf.eclipsefp.haskell.ui/plugin.xml
@@ -320,7 +320,25 @@
name="%stylishHaskellPP_name"
category="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.ScionPP">
</page>
-
+ <page
+ class="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.AlexPP"
+ id="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.AlexPP"
+ name="%alexPP_name"
+ category="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.ScionPP">
+ </page>
+ <page
+ class="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.HappyPP"
+ id="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.HappyPP"
+ name="%happyPP_name"
+ category="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.ScionPP">
+ </page>
+ <page
+ class="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.UuagcPP"
+ id="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.UuagcPP"
+ name="%uuagcPP_name"
+ category="net.sf.eclipsefp.haskell.ui.internal.preferences.scion.ScionPP">
+ </page>
+
<page
class="net.sf.eclipsefp.haskell.ui.internal.preferences.DebugPP"
id="net.sf.eclipsefp.haskell.ui.internal.preferences.DebugPP"
View
3 ...haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/IPreferenceConstants.java
@@ -48,6 +48,9 @@
public final static String HLINT_EXECUTABLE="HLINT_EXECUTABLE"; //$NON-NLS-1$
public final static String YESOD_EXECUTABLE="YESOD_EXECUTABLE"; //$NON-NLS-1$
public final static String SNAP_EXECUTABLE="SNAP_EXECUTABLE"; //$NON-NLS-1$
+ public final static String ALEX_EXECUTABLE="ALEX_EXECUTABLE"; //$NON-NLS-1$
+ public final static String HAPPY_EXECUTABLE="HAPPY_EXECUTABLE"; //$NON-NLS-1$
+ public final static String UUAGC_EXECUTABLE="UUAGC_EXECUTABLE"; //$NON-NLS-1$
/**
* Source-graph
View
21 ...lipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/scion/AlexPP.java
@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) 2012 by JP Moresmau
+ * This code is made available under the terms of the Eclipse Public License,
+ * version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
+ */
+package net.sf.eclipsefp.haskell.ui.internal.preferences.scion;
+
+import net.sf.eclipsefp.haskell.ui.internal.preferences.IPreferenceConstants;
+
+
+/**
+ * Helper preference page for Alex
+ * @author JP Moresmau
+ *
+ */
+public class AlexPP extends ExecutablePP {
+
+ public AlexPP(){
+ super("Alex","alex",IPreferenceConstants.ALEX_EXECUTABLE);
+ }
+}
View
21 ...ipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/scion/HappyPP.java
@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) 2012 by JP Moresmau
+ * This code is made available under the terms of the Eclipse Public License,
+ * version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
+ */
+package net.sf.eclipsefp.haskell.ui.internal.preferences.scion;
+
+import net.sf.eclipsefp.haskell.ui.internal.preferences.IPreferenceConstants;
+
+
+/**
+ * Helper preference page for Happy
+ * @author JP Moresmau
+ *
+ */
+public class HappyPP extends ExecutablePP {
+
+ public HappyPP(){
+ super("Happy","happy",IPreferenceConstants.HAPPY_EXECUTABLE);
+ }
+}
View
21 ...ipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/scion/UuagcPP.java
@@ -0,0 +1,21 @@
+/**
+ * Copyright (c) 2012 by JP Moresmau
+ * This code is made available under the terms of the Eclipse Public License,
+ * version 1.0 (EPL). See http://www.eclipse.org/legal/epl-v10.html
+ */
+package net.sf.eclipsefp.haskell.ui.internal.preferences.scion;
+
+import net.sf.eclipsefp.haskell.ui.internal.preferences.IPreferenceConstants;
+
+
+/**
+ * Helper preference page for UUAGC
+ * @author JP Moresmau
+ *
+ */
+public class UuagcPP extends ExecutablePP {
+
+ public UuagcPP(){
+ super("UUAGC","uuagc",IPreferenceConstants.UUAGC_EXECUTABLE);
+ }
+}
View
25 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/scion/ScionManager.java
@@ -21,6 +21,9 @@
import net.sf.eclipsefp.haskell.core.cabalmodel.PackageDescriptionStanza;
import net.sf.eclipsefp.haskell.core.cabalmodel.RealValuePosition;
import net.sf.eclipsefp.haskell.core.code.ModuleCreationInfo;
+import net.sf.eclipsefp.haskell.core.partitioned.runner.AlexRunner;
+import net.sf.eclipsefp.haskell.core.partitioned.runner.HappyRunner;
+import net.sf.eclipsefp.haskell.core.partitioned.runner.UuagcRunner;
import net.sf.eclipsefp.haskell.core.project.HaskellNature;
import net.sf.eclipsefp.haskell.hlint.HLintPlugin;
import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
@@ -225,10 +228,10 @@ public void run() {
browserSetup();
}
- String hlint=preferenceStore.getString( IPreferenceConstants.HLINT_EXECUTABLE );
- if (hlint!=null){
- HLintPlugin.setHlintPath( hlint );
- }
+ HLintPlugin.setHlintPath( preferenceStore.getString( IPreferenceConstants.HLINT_EXECUTABLE ));
+ AlexRunner.setFullPath( preferenceStore.getString( IPreferenceConstants.ALEX_EXECUTABLE ) );
+ HappyRunner.setFullPath( preferenceStore.getString( IPreferenceConstants.HAPPY_EXECUTABLE ) );
+ UuagcRunner.setFullPath( preferenceStore.getString( IPreferenceConstants.UUAGC_EXECUTABLE ) );
// Sit and listen to the preference store changes
preferenceStore.addPropertyChangeListener( new ExecutablesPropertiesListener() );
@@ -599,9 +602,21 @@ public void propertyChange( final PropertyChangeEvent event ) {
checkHoogleDataIsPresent((String)event.getNewValue());
}
} else if (event.getProperty().equals(IPreferenceConstants.HLINT_EXECUTABLE)){
- if (event.getNewValue() instanceof String){
+ if (event.getNewValue() instanceof String || event.getNewValue()==null){
HLintPlugin.setHlintPath( (String)event.getNewValue() );
}
+ } else if (event.getProperty().equals(IPreferenceConstants.ALEX_EXECUTABLE)){
+ if (event.getNewValue() instanceof String || event.getNewValue()==null){
+ AlexRunner.setFullPath( (String)event.getNewValue() );
+ }
+ } else if (event.getProperty().equals(IPreferenceConstants.HAPPY_EXECUTABLE)){
+ if (event.getNewValue() instanceof String || event.getNewValue()==null){
+ HappyRunner.setFullPath( (String)event.getNewValue() );
+ }
+ } else if (event.getProperty().equals(IPreferenceConstants.UUAGC_EXECUTABLE)){
+ if (event.getNewValue() instanceof String || event.getNewValue()==null){
+ UuagcRunner.setFullPath( (String)event.getNewValue() );
+ }
} else if (event.getProperty().equals(IPreferenceConstants.VERBOSE_INTERACTION)){
boolean verbose = ((Boolean)event.getNewValue()).booleanValue();
BuildWrapperPlugin.logAnswers=verbose;

0 comments on commit 08fa6c0

Please sign in to comment.
Something went wrong with that request. Please try again.