Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

check return code

  • Loading branch information...
commit 773e416f566cde2f57639aa84ec9a02a50eb6ccd 1 parent a4ce338
@JPMoresmau authored
View
1  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
View
2  net.sf.eclipsefp.haskell-feature/feature.xml
@@ -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
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);
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.