1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix for bug 250972

This commit is contained in:
Mike Kucera 2008-10-16 19:50:32 +00:00
parent 0cd1be7cee
commit f91408d15a
3 changed files with 9 additions and 3 deletions

View file

@ -473,7 +473,8 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
// crecoskie
// TODO FIXME: include entries don't handle URIs yet
if (includeReference.isOnIncludeEntry(URIUtil.toPath(locationURI))) {
IPath path = URIUtil.toPath(locationURI);
if (path != null && includeReference.isOnIncludeEntry(path)) {
String headerContentTypeId= contentTypeId;
if (headerContentTypeId == null) {
headerContentTypeId= CoreModel.hasCCNature(project) ? CCorePlugin.CONTENT_TYPE_CXXHEADER : CCorePlugin.CONTENT_TYPE_CHEADER;

View file

@ -85,6 +85,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.content.IContentType;
/**
@ -753,7 +754,8 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
language = LanguageManager.getInstance().getLanguageForFile(file, configuration, contentTypeId);
}
else {
language = LanguageManager.getInstance().getLanguageForFile(getLocation(), getCProject().getProject(), configuration, contentTypeId);
String filename = getElementName();
language = LanguageManager.getInstance().getLanguageForFile(new Path(filename), getCProject().getProject(), configuration, contentTypeId);
}
return language;
}

View file

@ -115,7 +115,10 @@ public class ExternalEditorInput implements ITranslationUnitEditorInput, IPersis
* @see IEditorInput#getToolTipText()
*/
public String getToolTipText() {
return externalFile.getFullPath().toString();
IPath path = externalFile.getFullPath();
if(path != null)
return path.toString();
return unit.getLocationURI().toString();
}
/* (non-Javadoc)