1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

RESOLVED - bug 268145: include heuristics break standalone indexing

https://bugs.eclipse.org/bugs/show_bug.cgi?id=268145
This commit is contained in:
Chris Recoskie 2009-03-25 14:33:44 +00:00
parent dfc2eb9c52
commit f0bc570599
4 changed files with 24 additions and 11 deletions

View file

@ -45,7 +45,7 @@ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter {
@Override
public long getLastModified(IIndexFileLocation location) {
return new File(location.getFullPath()).lastModified();
return new File(URIUtil.toPath(location.getURI()).toOSString()).lastModified();
}
@Override
@ -65,7 +65,7 @@ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter {
@Override
public String getASTPath(IIndexFileLocation ifl) {
return ifl.getFullPath();
return URIUtil.toPath(ifl.getURI()).toOSString();
}
@Override
@ -101,7 +101,7 @@ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter {
// use the original
}
//Stand-alone indexing stores the absolute paths of files being indexed
result = new IndexFileLocation(URIUtil.toURI(includePath),includePath);
result = new IndexFileLocation(URIUtil.toURI(includePath),null);
fIflCache.put(includePath, result);
}
return result;
@ -128,7 +128,7 @@ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter {
@Override
public Object getInputFile(IIndexFileLocation location) {
return location.getFullPath();
return URIUtil.toPath(location.getURI());
}
@Override

View file

@ -186,6 +186,16 @@ public abstract class StandaloneIndexerTask extends AbstractIndexerTask {
protected IStatus createStatus(String msg) {
return new Status(IStatus.ERROR, "org.eclipse.cdt.core", IStatus.ERROR, msg, null); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.pdom.PDOMWriter#createStatus(java.lang.String, java.lang.Throwable)
*/
@Override
protected IStatus createStatus(String msg, Throwable e) {
return new Status(IStatus.ERROR, "org.eclipse.cdt.core", IStatus.ERROR, msg, e); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask#getMessage(org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.MessageKind, java.lang.Object[])

View file

@ -717,7 +717,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
s= new Status(s.getSeverity(), s.getPlugin(), s.getCode(), s.getMessage(), e);
}
} else {
s= CCorePlugin.createStatus(getMessage(MessageKind.errorWhileParsing, file), e);
s= createStatus(getMessage(MessageKind.errorWhileParsing, file), e);
}
logError(s);
if (++fStatistics.fErrorCount > MAX_ERRORS) {
@ -817,10 +817,6 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
}
protected IStatus createStatus(String msg) {
return CCorePlugin.createStatus(msg);
}
/**
* @return array of linkage IDs that should be parsed
*/

View file

@ -211,8 +211,7 @@ abstract public class PDOMWriter {
th= e;
}
if (th != null) {
stati.add(CCorePlugin.createStatus(
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), th));
stati.add(createStatus(NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath(), th)));
}
if (i<ifls.length-1) {
updateFileCount(0, 0, 1); // update header count
@ -526,4 +525,12 @@ abstract public class PDOMWriter {
System.out.println(msg);
}
protected IStatus createStatus(String msg) {
return CCorePlugin.createStatus(msg);
}
protected IStatus createStatus(String msg, Throwable e) {
return CCorePlugin.createStatus(msg, e);
}
}