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:
parent
0ab89e9c79
commit
be1435ad0a
1 changed files with 9 additions and 2 deletions
|
@ -19,8 +19,8 @@ import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ILinkage;
|
import org.eclipse.cdt.core.dom.ILinkage;
|
||||||
|
@ -573,7 +573,14 @@ public class LanguageManager {
|
||||||
IProject project = file.getProject();
|
IProject project = file.getProject();
|
||||||
|
|
||||||
if (contentTypeId == null) {
|
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) {
|
if (contentType == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue