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

bug 353831: LanguageManager.getLanguageForFile(IFile...) cannot handle

EFS resources
This commit is contained in:
Andrew Gvozdev 2011-08-08 15:19:16 -04:00
parent 0ab89e9c79
commit be1435ad0a

View file

@ -19,8 +19,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ILinkage;
@ -573,7 +573,14 @@ public class LanguageManager {
IProject project = file.getProject();
if (contentTypeId == null) {
IContentType contentType= CContentTypes.getContentType(project, file.getLocation().toString());
IPath location = file.getLocation();
String filename;
if (location != null) {
filename = location.toString();
} else {
filename = file.getName();
}
IContentType contentType= CContentTypes.getContentType(project, filename);
if (contentType == null) {
return null;
}