1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

incorrect source lookup fallback when file is not in workspace

Change-Id: I9f7c5f3c46a26053123d28f30a7b8712eb8c9254
This commit is contained in:
Alena Laskavaia 2015-11-25 15:08:14 -05:00 committed by Elena Laskavaia
parent 04bf520618
commit 9e38beb510

View file

@ -285,7 +285,10 @@ public class SourceUtils {
if (lcProject != null) { if (lcProject != null) {
ICProject project = CoreModel.getDefault().create(lcProject); ICProject project = CoreModel.getDefault().create(lcProject);
if (project != null) { if (project != null) {
return new ITranslationUnit[] { CoreModel.getDefault().createTranslationUnitFrom(project, URIUtil.toURI(file.getCanonicalPath(), true)) }; ITranslationUnit translationUnit = CoreModel.getDefault().createTranslationUnitFrom(project,
URIUtil.toURI(file.getCanonicalPath(), true));
if (translationUnit != null) // if we failed do not return array with null in it
return new ITranslationUnit[] { translationUnit };
} }
} }
} catch (IOException e) { // ignore if getCanonicalPath throws } catch (IOException e) { // ignore if getCanonicalPath throws