Community
Participate
Working Groups
LanguageManager.getLanguageForFile(IFile file...) assumes resources on local filesystem and cannot handle EFS resources due to code IContentType contentType= CContentTypes.getContentType(project, file.getLocation().toString()); That causes NPE as file.getLocation() returns null for EFS resources.
Created attachment 200864 [details] suggested patch I am unsure which way to fix the issue is the correct one. Being not too much experienced in intricacies of determining languages or content types it feels that the attached patch is the "safest" one. Or should I just use file.getName() for filename? Maybe there is a better way to figure out language ID for IFile? I've looked but haven't found one.
OK, nobody objects. Committed on master.
*** cdt git genie on behalf of Andrew Gvozdev *** bug 353831: LanguageManager.getLanguageForFile(IFile...) cannot handle EFS resources [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=be1435ad0aa79768bb03030a333084bed1ea2929