Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 4 commits
  • 12 files changed
  • 0 commit comments
  • 1 contributor
View
6 docs/releasenotes/net.sf.eclipsefp.haskell_2.3.2.txt
@@ -17,6 +17,7 @@ Fixes:
- synchronize operations do not block other operations
- Terminating a debugging session when stopped at a breakpoint removes correctly breakpoint marker in code
- Terminating a debugging session correctly forbids to resume execution (restart a new session)
+ - Do not try to parse hlint output if the process returned in error
Features:
- Specify the cabal stanza you want to use settings from when checking a file in the editor
@@ -26,7 +27,8 @@ Features:
- BuildWrapper and scion-browser should build with GHC 7.6
- If you run a GHCi session in debug mode and launch a function with :trace, :hist output will show as a stack trace in the Debug perspective
- Watch action on editor adds the selected text as a debug expression
- - Inspect action on editor evaluates the expression in current GHCi session (only visible if stopped at a breakpoint in debug GHCi session)
+ - Display action on editor evaluates the expression in current GHCi session (only visible if stopped at a breakpoint in debug GHCi session)
+ - Scion-browser path is optional in preferences
Internal:
- Hopefully performance of some UI operations has been enhanced and the UI should be more responsive in places
@@ -37,5 +39,5 @@ Upgrade notes:
Known issues:
-Thanks to all bug reporters and users for their feedback.
+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
4 net.sf.eclipsefp.haskell-feature/feature.xml
@@ -88,7 +88,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.doc.user"
download-size="0"
install-size="0"
- version="2.2.4"
+ version="2.3.2"
unpack="false"/>
<plugin
@@ -151,7 +151,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.hlint"
download-size="0"
install-size="0"
- version="2.3.1"
+ version="2.3.2"
unpack="false"/>
<plugin
View
1  ...ipsefp.haskell.debug.core/src/net/sf/eclipsefp/haskell/debug/core/internal/debug/HaskellDebugTarget.java
@@ -105,7 +105,6 @@ public HaskellDebugTarget(final ILaunch launch, final IProcess process){
this.fProcess.getStreamsProxy().getOutputStreamMonitor().addListener( this );
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- instances(1);
}
@Override
View
18 net.sf.eclipsefp.haskell.doc.user/META-INF/MANIFEST.MF
@@ -1,9 +1,9 @@
-Manifest-Version: 1.0
-Bundle-Name: %bundleName
-Bundle-SymbolicName: net.sf.eclipsefp.haskell.doc.user;singleton:=true
-Bundle-Version: 2.2.4
-Bundle-Vendor: %bundleVendor
-Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
-Bundle-ManifestVersion: 2
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Manifest-Version: 1.0
+Bundle-Name: %bundleName
+Bundle-SymbolicName: net.sf.eclipsefp.haskell.doc.user;singleton:=true
+Bundle-Version: 2.3.2
+Bundle-Vendor: %bundleVendor
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-ManifestVersion: 2
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
View
93 net.sf.eclipsefp.haskell.doc.user/html/userGuide/debugging.html
@@ -1,41 +1,52 @@
-<html>
-<head>
-<link rel="stylesheet" href="../../../PRODUCT_PLUGIN/book.css" type="text/css">
-</head>
-
-<body>
-
-<h1>Debugging</h1>
-
-<p>This plug-in supports debugging of Haskell modules using GHCi. That means that the features
-in this section are available only if the module is run within a GHCi session. To do this,
-right-click the module, and select <b>Debug As &gt; GHCi session</b>.</p>
-
-<p>You can add breakpoints in your code double-clicking in the left margin of the source code
-editor. A small blue circle will appear in the selected line. You can delete the breakpoint
-double-clicking one of those circles. Note that currently EclipseFP does not allow to set
-breakpoints in particular expressions, only in entire lines.</p>
-
-<p>Once you start running functions in your module, it is recommended to change to the
-<i>Debug</i> perspective by going to the main menu and selecting
-<b>Window &gt; Open Perspective &gt; Debug</b>. This gives you access to the debugging tools.</p>
-
-<p>When a breakpoint is reached, the expression being evaluated is shown with a different
-background in the code editor. You can step or continue using the buttons available in
-the <i>Debug</i> view.</p>
-
-<p>You can also inspect the value of the variables in the <i>Variables</i> view. As withing GHCi,
-variables that aren't yet evaluated are shown as <code>_</code>.</p>
-
-<h3>Debugging an executable</h3>
-
-<p>EclipseFP does not support direct debugging of executables. However, you can simulate it
-following these steps:
-<li>Right-click your main module and select debugging within GHCi,</li>
-<li>If you havne't done it yet, add breakpoints to your code,</li>
-<li>In the GHCi console, write <code>main</code> and press the Enter key. This will
-execute the <code>main</code> function, which is the entry point of your application.</li>
-</p>
-
-</body>
-</html>
+<html>
+<head>
+<link rel="stylesheet" href="../../../PRODUCT_PLUGIN/book.css" type="text/css">
+</head>
+
+<body>
+
+<h1>Debugging</h1>
+
+<p>This plug-in supports debugging of Haskell modules using GHCi. That means that the features
+in this section are available only if the module is run within a GHCi session. To do this,
+right-click the module, and select <b>Debug As &gt; GHCi session</b>.</p>
+
+<p>You can add breakpoints in your code double-clicking in the left margin of the source code
+editor. A small blue circle will appear in the selected line. You can delete the breakpoint
+double-clicking one of those circles. Note that currently EclipseFP does not allow to set
+breakpoints in particular expressions, only in entire lines.</p>
+
+<p>Once you start running functions in your module, it is recommended to change to the
+<i>Debug</i> perspective by going to the main menu and selecting
+<b>Window &gt; Open Perspective &gt; Debug</b>. This gives you access to the debugging tools.</p>
+
+<p>When a breakpoint is reached, the expression being evaluated is shown with a different
+background in the code editor. You can step or continue using the buttons available in
+the <i>Debug</i> view.</p>
+
+<p>You can also inspect the value of the variables in the <i>Variables</i> view. As withing GHCi,
+variables that aren't yet evaluated are shown as <code>_</code>. Typing something in the variable value field causes
+evaluation of the variable, which may modify the performance or behavior of your program.</p>
+
+<p>You can also add Expressions in the Expressions view. You can create new expressions by typing the full code, and you can also
+select expressions in your code, right click and choose <b>Watch</b>. If you only want to see the value of an expression at
+one point in time you can just select the expression in the code, right click and choose <b>Display</b>. A popup will appear with the
+current value.</p>
+
+<p>GHCi does not have the concept of stack traces (which are not always relevant in a lazy language). However it can keep the
+history of expressions it has evaluated. EclipseFP translates this history in stack frames in the <i>Debug</i> view. Just
+launch your function with :trace to get reliable history information (For example, if you want to launch your main function in GHCi,
+type in <code>:trace main</code>);</p>
+
+<h3>Debugging an executable</h3>
+
+<p>EclipseFP does not support direct debugging of executables. However, you can simulate it
+following these steps:
+<li>Right-click your main module and select debugging within GHCi,</li>
+<li>If you havne't done it yet, add breakpoints to your code,</li>
+<li>In the GHCi console, write <code>main</code> and press the Enter key. This will
+execute the <code>main</code> function, which is the entry point of your application.</li>
+</p>
+
+</body>
+</html>
View
2  net.sf.eclipsefp.haskell.hlint/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.hlint;singleton:=true
-Bundle-Version: 2.3.1
+Bundle-Version: 2.3.2
Bundle-Activator: net.sf.eclipsefp.haskell.hlint.HLintPlugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
View
107 net.sf.eclipsefp.haskell.hlint/src/net/sf/eclipsefp/haskell/hlint/HLintRunner.java
@@ -1,53 +1,54 @@
-/**
- * (c) 2011, Alejandro Serrano
- * Released under the terms of the EPL.
- */
-package net.sf.eclipsefp.haskell.hlint;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import net.sf.eclipsefp.haskell.hlint.parser.OutputParser;
-import net.sf.eclipsefp.haskell.hlint.util.HLintText;
-import net.sf.eclipsefp.haskell.util.ProcessRunner;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Class the encapsulates the logic of calling hlint and
- * sending the output to the parser to generate a list
- * of suggestions.
- *
- * @author Alejandro Serrano
- * @author JP Moresmau
- *
- */
-public class HLintRunner {
-
- public List<Suggestion> run(IPath path) {
- StringWriter err=new StringWriter();
- StringWriter out=new StringWriter();
- try {
- String exe=HLintPlugin.getHlintPath();
- if (exe==null || exe.length()==0){
- exe="hlint"; // hope it's in the path
- }
- new ProcessRunner().executeBlocking(path.toFile().getParentFile(), out, err, exe, path.toOSString());
-
- OutputParser parser = new OutputParser(new StringReader(out.toString()));
- return parser.suggestions();
- } catch (Throwable ex) {
- String msg=err.toString().length()>0?err.toString():out.toString();
- HLintPlugin.logError(NLS.bind(HLintText.error_run,msg), ex);
- }
- return new ArrayList<Suggestion>();
- }
-
- public static List<Suggestion> runHLintOn(IPath path) {
- HLintRunner runner = new HLintRunner();
- return runner.run(path);
- }
-}
+/**
+ * (c) 2011, Alejandro Serrano
+ * Released under the terms of the EPL.
+ */
+package net.sf.eclipsefp.haskell.hlint;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.eclipsefp.haskell.hlint.parser.OutputParser;
+import net.sf.eclipsefp.haskell.hlint.util.HLintText;
+import net.sf.eclipsefp.haskell.util.ProcessRunner;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Class the encapsulates the logic of calling hlint and
+ * sending the output to the parser to generate a list
+ * of suggestions.
+ *
+ * @author Alejandro Serrano
+ * @author JP Moresmau
+ *
+ */
+public class HLintRunner {
+
+ public List<Suggestion> run(IPath path) {
+ StringWriter err=new StringWriter();
+ StringWriter out=new StringWriter();
+ try {
+ String exe=HLintPlugin.getHlintPath();
+ if (exe==null || exe.length()==0){
+ exe="hlint"; // hope it's in the path
+ }
+ int code=new ProcessRunner().executeBlocking(path.toFile().getParentFile(), out, err, exe, path.toOSString());
+ if (code==0){
+ OutputParser parser = new OutputParser(new StringReader(out.toString()));
+ return parser.suggestions();
+ }
+ } catch (Throwable ex) {
+ String msg=err.toString().length()>0?err.toString():out.toString();
+ HLintPlugin.logError(NLS.bind(HLintText.error_run,msg), ex);
+ }
+ return new ArrayList<Suggestion>();
+ }
+
+ public static List<Suggestion> runHLintOn(IPath path) {
+ HLintRunner runner = new HLintRunner();
+ return runner.run(path);
+ }
+}
View
4 net.sf.eclipsefp.haskell.ui/plugin.properties
@@ -122,8 +122,8 @@ openDefinitionCommand_desc = Opens an editor on the declaration of the selected
watchExpressionCommand_name=Watch
watchExpressionCommand_desc=Add the selected code to the watched expressions
-inspectExpressionCommand_name=Inspect
-inspectExpressionCommand_desc=See the current value of the expression
+displayExpressionCommand_name=Display
+displayExpressionCommand_desc=See the current value of the expression
searchHoogleAction_label = Search in &Hoogle
searchHoogleAction_tooltip = Search for the select element in Hoogle
View
14 net.sf.eclipsefp.haskell.ui/plugin.xml
@@ -481,10 +481,10 @@
name="%watchExpressionCommand_name"
id="net.sf.eclipsefp.ui.commands.run.watchExpression"/>
<command
- description="%inspectExpressionCommand_desc"
+ description="%displayExpressionCommand_desc"
categoryId="org.eclipse.debug.ui.category.run"
- name="%inspectExpressionCommand_name"
- id="net.sf.eclipsefp.ui.commands.run.inspectExpression"/>
+ name="%displayExpressionCommand_name"
+ id="net.sf.eclipsefp.ui.commands.run.displayExpression"/>
<command
description="%HaddockDocumentFollowing.description"
categoryId="net.sf.eclipsefp.haskell.ui.category.source"
@@ -531,7 +531,7 @@
<menuContribution
locationURI="menu:org.eclipse.ui.run?after=emptyBreakpointGroup">
<command
- commandId="net.sf.eclipsefp.ui.commands.run.inspectExpression"
+ commandId="net.sf.eclipsefp.ui.commands.run.displayExpression"
icon="icons/etool16/insp_exp.gif">
<visibleWhen checkEnabled="true"/>
</command>
@@ -561,7 +561,7 @@
<menuContribution
locationURI="popup:#HaskellEditorContext?after=additions">
<command
- commandId="net.sf.eclipsefp.ui.commands.run.inspectExpression"
+ commandId="net.sf.eclipsefp.ui.commands.run.displayExpression"
icon="icons/etool16/insp_exp.gif">
<visibleWhen checkEnabled="true"/>
</command>
@@ -728,8 +728,8 @@
</handler>
<!-- handler for the Inspect expression action when invoked from the HaskellEditor -->
<handler
- class="net.sf.eclipsefp.haskell.ui.handlers.InspectExpressionHandler"
- commandId="net.sf.eclipsefp.ui.commands.run.inspectExpression">
+ class="net.sf.eclipsefp.haskell.ui.handlers.DisplayExpressionHandler"
+ commandId="net.sf.eclipsefp.ui.commands.run.displayExpression">
<activeWhen>
<and>
<reference
View
90 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/handlers/DisplayExpressionHandler.java
@@ -0,0 +1,90 @@
+/**
+ * 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.handlers;
+
+import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellDebugElement;
+import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellValue;
+import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
+import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.model.ISuspendResume;
+import org.eclipse.debug.ui.DebugPopup;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+
+/**
+ * Inspect the current value of the selected expression
+ * @author JP Moresmau
+ *
+ */
+public class DisplayExpressionHandler extends WatchExpressionHandler {
+
+ /* (non-Javadoc)
+ * @see net.sf.eclipsefp.haskell.ui.handlers.WatchExpressionHandler#addExpression(java.lang.String)
+ */
+ @Override
+ protected void addExpression(final HaskellEditor hEditor, final String s ) {
+ IAdaptable context = DebugUITools.getDebugContext();
+ if (context instanceof HaskellDebugElement){
+ final HaskellDebugElement hde=(HaskellDebugElement)context;
+ if ((hde instanceof ISuspendResume && ((ISuspendResume)hde).isSuspended()) || hde.getDebugTarget().isSuspended()){
+ try {
+ final HaskellValue val=hde.getDebugTarget().evaluate( s );
+ hEditor.getEditorSite().getShell().getDisplay().asyncExec( new Runnable(){
+ @Override
+ public void run() {
+ Point p=hEditor.getSelectedPoint();
+ new InspectDialog(hEditor, new Point( p.x, p.y+20 ),s,val.getValueString()).open();
+ //new InspectPopupDialog( hEditor.getEditorSite().getShell(), new Point( p.x, p.y+20 ), null, new HaskellExpression( hde.getDebugTarget(), s, val ) ).open();
+ }
+ });
+
+ } catch (DebugException de){
+ HaskellUIPlugin.log( de );
+ }
+
+ }
+ }
+
+ }
+
+ private static class InspectDialog extends DebugPopup{
+ private final String val;
+ /**
+ *
+ */
+ public InspectDialog(final HaskellEditor hEditor,final Point location,final String exp,final String val) {
+ super(hEditor.getEditorSite().getShell(),location,null);
+ setTitleText( exp );
+ this.val=val;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea( final Composite parent ) {
+ Composite composite=new Composite(parent,SWT.NONE);
+ composite.setLayout( new GridLayout(1,true) );
+ composite.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH) );
+ //Composite)super.createDialogArea( parent );
+ Label l=new Label(composite,SWT.NONE);
+ l.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL) );
+ l.setText( val );
+ l.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH) );
+ composite.layout( true );
+ return composite;
+ }
+ }
+}
View
80 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/handlers/InspectExpressionHandler.java
@@ -1,80 +0,0 @@
-/**
- * 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.handlers;
-
-import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellDebugElement;
-import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellExpression;
-import net.sf.eclipsefp.haskell.debug.core.internal.debug.HaskellValue;
-import net.sf.eclipsefp.haskell.ui.HaskellUIPlugin;
-import net.sf.eclipsefp.haskell.ui.internal.editors.haskell.HaskellEditor;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.InspectPopupDialog;
-import org.eclipse.swt.graphics.Point;
-
-
-/**
- * Inspect the current value of the selected expression
- * @author JP Moresmau
- *
- */
-public class InspectExpressionHandler extends WatchExpressionHandler {
-
- /* (non-Javadoc)
- * @see net.sf.eclipsefp.haskell.ui.handlers.WatchExpressionHandler#addExpression(java.lang.String)
- */
- @Override
- protected void addExpression(final HaskellEditor hEditor, final String s ) {
- IAdaptable context = DebugUITools.getDebugContext();
- if (context instanceof HaskellDebugElement){
- final HaskellDebugElement hde=(HaskellDebugElement)context;
- if ((hde instanceof ISuspendResume && ((ISuspendResume)hde).isSuspended()) || hde.getDebugTarget().isSuspended()){
- try {
- final HaskellValue val=hde.getDebugTarget().evaluate( s );
- hEditor.getEditorSite().getShell().getDisplay().asyncExec( new Runnable(){
- @Override
- public void run() {
- Point p=hEditor.getSelectedPoint();
- //new InspectDialog(hEditor,s,res).open();
- new InspectPopupDialog( hEditor.getEditorSite().getShell(), new Point( p.x, p.y+20 ), null, new HaskellExpression( hde.getDebugTarget(), s, val ) ).open();
- }
- });
-
- } catch (DebugException de){
- HaskellUIPlugin.log( de );
- }
-
- }
- }
-
- }
-
-// private static class InspectDialog extends PopupDialog{
-// private final String val;
-// /**
-// *
-// */
-// public InspectDialog(final HaskellEditor hEditor,final String exp,final String val) {
-// super(hEditor.getEditorSite().getShell(),PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE,false,false,false,false,false,exp,"");
-// this.val=val;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
-// */
-// @Override
-// protected Control createDialogArea( final Composite parent ) {
-// Composite composite=(Composite)super.createDialogArea( parent );
-// Label l=new Label(composite,SWT.NONE);
-// l.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL) );
-// l.setText( val );
-// composite.layout( true );
-// return composite;
-// }
-// }
-}
View
17 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/scion/ScionPP.java
@@ -239,14 +239,15 @@ public boolean isValid() {
//}
}
- if (retval) {
- //if (!browserBuiltInField.getBooleanValue()) {
- if (!browserExecutableField.isValid()) {
- retval = false;
- setErrorMessage( UITexts.cabalImplsBlock_needBrowserExecutablePath );
- }
- //}
- }
+ /** do not force scion-browser to be present **/
+// if (retval) {
+// //if (!browserBuiltInField.getBooleanValue()) {
+// if (!browserExecutableField.isValid()) {
+// retval = false;
+// setErrorMessage( UITexts.cabalImplsBlock_needBrowserExecutablePath );
+// }
+// //}
+// }
if (retval) {
// Clear the message

No commit comments for this range

Something went wrong with that request. Please try again.