diff --git a/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/BWFacade.java b/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/BWFacade.java index 2134aaaf2..ae31acbc6 100644 --- a/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/BWFacade.java +++ b/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/BWFacade.java @@ -181,9 +181,11 @@ public boolean build1(IFile file){ LinkedList command=new LinkedList(); command.add("build1"); command.add("--file="+path); + //long t0=System.currentTimeMillis(); //command.add("--buildflags="+escapeFlags(i.getFlags())); JSONArray arr=run(command,ARRAY); - + //long t1=System.currentTimeMillis(); + //BuildWrapperPlugin.logInfo("build:"+(t1-t0)+"ms"); if (arr!=null && arr.length()>1){ Set ress=new HashSet(); ress.add(file); diff --git a/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/types/Location.java b/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/types/Location.java index b511781de..35e811d30 100644 --- a/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/types/Location.java +++ b/net.sf.eclipsefp.haskell.buildwrapper/src/net/sf/eclipsefp/haskell/buildwrapper/types/Location.java @@ -31,21 +31,22 @@ public Location(JSONObject json) throws JSONException { } public Location(IFile f, JSONArray json) throws JSONException { - startLine=json.getInt(0); - startColumn=json.getInt(1)-1; // we're zero based, Haskell code 1 based - endLine=json.getInt(2); - endColumn=json.getInt(3)-1;// we're zero based, Haskell code 1 based - if (endColumn==-1 && endLine>startLine){ - endLine--; - } - this.fileName = f.getLocation().toOSString(); + this(f.getLocation().toOSString(),json); } public Location(String fn, JSONArray json) throws JSONException { startLine=json.getInt(0); startColumn=json.getInt(1)-1; // we're zero based, Haskell code 1 based - endLine=json.getInt(2); - endColumn=json.getInt(3)-1;// we're zero based, Haskell code 1 based + if (json.length()>3){ + endLine=json.getInt(2); + endColumn=json.getInt(3)-1;// we're zero based, Haskell code 1 based + } else if (json.length()>2){ + endLine=startLine; + endColumn=json.getInt(2)-1;// we're zero based, Haskell code 1 based + } else { + endLine=startLine; + endColumn=startColumn+1; + } if (endColumn==-1 && endLine>startLine){ endLine--; }