From 3fc1ce92e7424b3acbae891cb60795108ccd610a Mon Sep 17 00:00:00 2001 From: Vivian Kong Date: Thu, 17 May 2012 11:33:15 -0400 Subject: [PATCH] Bug 379492 - IBFile should account for EFS external files --- .../eclipse/cdt/internal/ui/includebrowser/IBFile.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBFile.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBFile.java index 9e89e1715dc..8faf1a4193a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBFile.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/includebrowser/IBFile.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Markus Schorn - initial API and implementation + * IBM Corporation *******************************************************************************/ package org.eclipse.cdt.internal.ui.includebrowser; @@ -37,7 +38,10 @@ public class IBFile { public IBFile(ICProject preferredProject, IIndexFileLocation location) throws CModelException { fLocation= location; - fTU= CoreModelUtil.findTranslationUnitForLocation(location, preferredProject); + ITranslationUnit TU = CoreModelUtil.findTranslationUnitForLocation(location, preferredProject); + if (TU == null) //for EFS file that might not be on this filesystem + TU = CoreModelUtil.findTranslationUnitForLocation(location.getURI(), preferredProject); + fTU = TU; String name= fLocation.getURI().getPath(); fName= name.substring(name.lastIndexOf('/')+1); }