mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
FIx in the CViewLabel to not show the full includeReference paths
This commit is contained in:
parent
3fa86e4cce
commit
a075f3082c
1 changed files with 4 additions and 5 deletions
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.ui.cview;
|
||||||
import org.eclipse.cdt.core.model.IIncludeReference;
|
import org.eclipse.cdt.core.model.IIncludeReference;
|
||||||
import org.eclipse.cdt.internal.ui.IAdornmentProvider;
|
import org.eclipse.cdt.internal.ui.IAdornmentProvider;
|
||||||
import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider;
|
import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -43,11 +42,11 @@ public class CViewLabelProvider extends StandardCElementLabelProvider {
|
||||||
if (element instanceof IIncludeReference) {
|
if (element instanceof IIncludeReference) {
|
||||||
IIncludeReference ref = (IIncludeReference)element;
|
IIncludeReference ref = (IIncludeReference)element;
|
||||||
Object parent = ref.getParent();
|
Object parent = ref.getParent();
|
||||||
if (!(parent instanceof IIncludeReference)) {
|
if (parent instanceof IIncludeReference) {
|
||||||
IPath p = ref.getPath();
|
IPath p = ref.getPath();
|
||||||
IPath rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
|
IPath parentLocation = ((IIncludeReference)parent).getPath();
|
||||||
if (rootLocation.isPrefixOf(p)) {
|
if (parentLocation.isPrefixOf(p)) {
|
||||||
p = p.removeFirstSegments(rootLocation.segmentCount());
|
p = p.removeFirstSegments(parentLocation.segmentCount());
|
||||||
}
|
}
|
||||||
return p.toString();
|
return p.toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue