Skip to content
Browse files

only log "not enabled" outline errors

  • Loading branch information...
1 parent da302a2 commit 9d87dce778ffe30e831ace9c43959d18da389ce5 @JPMoresmau committed Aug 2, 2012
View
8 docs/releasenotes/net.sf.eclipsefp.haskell_2.3.1.txt
@@ -5,22 +5,24 @@ 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.0 of buildwrapper has been validated with this version of EclipseFP
+ - 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.1 of buildwrapper has been validated with this version of EclipseFP
- EclipseFP also uses scion-browser. Version 0.2.10 has been validated with this version of EclipseFP
Fixes:
- - Clean project removes all Haskell Problems markers in project
+ - Clean project removes all Haskell problems markers in project
- Autocomplete
- StackOverflow if a module exported itself fixed
- Now properly offers symbols from exposed modules from the library in the same project if there is an internal dependency
- - Various defensive codes
+ - Various defensive code
- Escape paths with spaces properly (SourceGraph and other tools invocation)
Features:
- Format source with stylish-haskell
- Command history for GHCi sessions
- Tooltips now can use HTML rendering
+ - Markers have column information and not only line information (squiggly lines are back).
+ - Hover over a symbol and a marker display both information.
Internal:
View
42 ...sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/BWFacade.java
@@ -22,15 +22,15 @@
import net.sf.eclipsefp.haskell.buildwrapper.types.CabalMessages;
import net.sf.eclipsefp.haskell.buildwrapper.types.CabalPackage;
import net.sf.eclipsefp.haskell.buildwrapper.types.Component;
-import net.sf.eclipsefp.haskell.buildwrapper.types.NameDef;
-import net.sf.eclipsefp.haskell.buildwrapper.types.ThingAtPoint;
import net.sf.eclipsefp.haskell.buildwrapper.types.Component.ComponentType;
import net.sf.eclipsefp.haskell.buildwrapper.types.Location;
+import net.sf.eclipsefp.haskell.buildwrapper.types.NameDef;
import net.sf.eclipsefp.haskell.buildwrapper.types.Note;
import net.sf.eclipsefp.haskell.buildwrapper.types.Note.Kind;
import net.sf.eclipsefp.haskell.buildwrapper.types.Occurrence;
import net.sf.eclipsefp.haskell.buildwrapper.types.OutlineDef;
import net.sf.eclipsefp.haskell.buildwrapper.types.OutlineResult;
+import net.sf.eclipsefp.haskell.buildwrapper.types.ThingAtPoint;
import net.sf.eclipsefp.haskell.buildwrapper.types.TokenDef;
import net.sf.eclipsefp.haskell.buildwrapper.util.BWText;
import net.sf.eclipsefp.haskell.util.FileUtil;
@@ -520,13 +520,25 @@ public OutlineResult outline(IFile file){
}
}
- List<Note> collect=new ArrayList<Note>();
if (arr.length()>1){
JSONArray notes=arr.optJSONArray(1);
//notes.putAll(i.getNotes());
- boolean b=parseNotes(notes,null,collect);
+ boolean b=parseNotes(notes,null,new NoteFilter() {
+
+ @Override
+ public boolean accept(Note n) {
+ return !n.getMessage().contains("not enabled");
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.eclipsefp.haskell.buildwrapper.BWFacade.NoteFilter#getLogPrefix()
+ */
+ @Override
+ public String getLogPrefix() {
+ return "Outline: ";
+ }
+ });
or.setBuildOK(b);
- or.setNotes(collect);
}
}
@@ -675,7 +687,7 @@ private boolean isOK(JSONArray notes){
return true;
}
- private boolean parseNotes(JSONArray notes,Set<IResource> ress,List<Note> collect){
+ private boolean parseNotes(JSONArray notes,Set<IResource> ress,NoteFilter filter){
boolean buildOK=true;
if (notes!=null){
try {
@@ -686,9 +698,7 @@ private boolean parseNotes(JSONArray notes,Set<IResource> ress,List<Note> collec
JSONObject o=notes.getJSONObject(a);
String sk=o.getString("s");
Kind k="Error".equalsIgnoreCase(sk)?Kind.ERROR:Kind.WARNING;
- if (k.equals(Kind.ERROR)){
- buildOK=false;
- }
+
JSONObject ol=o.getJSONObject("l");
String f=ol.getString("f");
int line=ol.getInt("l");
@@ -701,9 +711,10 @@ private boolean parseNotes(JSONArray notes,Set<IResource> ress,List<Note> collec
//ow.addMessage("\nCreated location: "+loc.getStartLine()+":"+loc.getStartColumn()+" to "+loc.getEndLine()+":"+loc.getEndColumn());
Note n=new Note(k,loc,o.getString("t"),"");
- if (collect!=null){
- collect.add(n);
- } else {
+ if (filter==null || filter.accept(n)){
+ if (k.equals(Kind.ERROR)){
+ buildOK=false;
+ }
IResource res=project.findMember(f);
// linker errors may have full path
if (res==null){
@@ -726,6 +737,8 @@ private boolean parseNotes(JSONArray notes,Set<IResource> ress,List<Note> collec
hasCabalProblems=true;
}
}
+ } else if (k.equals(Kind.ERROR)){
+ BuildWrapperPlugin.logError(filter.getLogPrefix()+n.toString(), null);
}
}
} catch (JSONException je){
@@ -1107,4 +1120,9 @@ public boolean isInTempFolder(IResource r){
}
return false;
}
+
+ private interface NoteFilter{
+ boolean accept(Note n);
+ String getLogPrefix();
+ }
}
View
4 ...f.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/JobFacade.java
@@ -216,9 +216,9 @@ protected IStatus run(IProgressMonitor monitor) {
// long t1=System.currentTimeMillis();
OutlineResult or=realFacade.outline(file);
//long t2=System.currentTimeMillis();
- //if (!or.isEmpty() || or.isBuildOK()){
+ if (!or.isEmpty() || or.isBuildOK()){
handler.handleOutline(or); // avoid removing all outline on error
- //}
+ }
//long t3=System.currentTimeMillis();
View
7 ...fp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/haskell/HaskellEditor.java
@@ -21,7 +21,6 @@
import net.sf.eclipsefp.haskell.buildwrapper.types.Location;
import net.sf.eclipsefp.haskell.buildwrapper.types.NameDef;
import net.sf.eclipsefp.haskell.buildwrapper.types.NameDefHandler;
-import net.sf.eclipsefp.haskell.buildwrapper.types.Note;
import net.sf.eclipsefp.haskell.buildwrapper.types.OutlineDef;
import net.sf.eclipsefp.haskell.buildwrapper.types.OutlineHandler;
import net.sf.eclipsefp.haskell.buildwrapper.types.OutlineResult;
@@ -154,21 +153,21 @@
@Override
public void handleOutline( final OutlineResult or ) {
- if (!or.getOutlineDefs().isEmpty() || or.isBuildOK()){// avoid removing all outline on error
+ //if (!or.getOutlineDefs().isEmpty() || or.isBuildOK()){// avoid removing all outline on error
if (outlinePage!=null){
outlinePage.setInput( or.getOutlineDefs() );
}
lastOutlineResult=or;
if (foldingStructureProvider!=null){
foldingStructureProvider.updateFoldingRegions( or.getOutlineDefs() );
}
- } else if (!or.isBuildOK() && or.getNotes()!=null && or.getNotes().size()>0){
+ /*} else if (!or.isBuildOK() && or.getNotes()!=null && or.getNotes().size()>0){
for (Note n:or.getNotes()){
if (n.getKind().equals( Note.Kind.ERROR )){
HaskellUIPlugin.log( n.toString(), IStatus.ERROR);
}
}
- }
+ }*/
}
};

0 comments on commit 9d87dce

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