mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 167549, location representation in PDOM.
This commit is contained in:
parent
2a9b29e5bf
commit
4adb553d14
2 changed files with 5 additions and 6 deletions
|
@ -90,6 +90,7 @@ public class PDOM extends PlatformObject implements IIndexFragment, IPDOM {
|
|||
// 18 - distinction between c-unions and c-structs.
|
||||
// 19 - alter representation of paths in the pdom (162172)
|
||||
// 20 - add pointer to member types, array types, return types for functions
|
||||
// 21 - change representation of paths in the pdom (167549)
|
||||
|
||||
public static final int LINKAGES = Database.DATA_AREA;
|
||||
public static final int FILE_INDEX = Database.DATA_AREA + 4;
|
||||
|
|
|
@ -25,12 +25,10 @@ import org.eclipse.core.runtime.Path;
|
|||
* The standard location converter used by the per-project PDOM
|
||||
*/
|
||||
public class PDOMProjectIndexLocationConverter implements IIndexLocationConverter {
|
||||
IProject project;
|
||||
IWorkspaceRoot root;
|
||||
private static final String EXTERNAL = "<EXT>"; //$NON-NLS-1$
|
||||
|
||||
public PDOMProjectIndexLocationConverter(IProject project) {
|
||||
this.project = project;
|
||||
this.root = ResourcesPlugin.getWorkspace().getRoot();
|
||||
}
|
||||
|
||||
|
@ -47,9 +45,9 @@ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverte
|
|||
uri = null;
|
||||
}
|
||||
} else {
|
||||
fullPath = "/"+project.getName()+"/"+raw; //$NON-NLS-1$//$NON-NLS-2$
|
||||
IResource member = project.findMember(raw);
|
||||
uri = member == null ? null : member.getLocationURI();
|
||||
fullPath = raw;
|
||||
IResource member= root.getFile(new Path(raw));
|
||||
uri = member.getLocationURI();
|
||||
}
|
||||
return new IndexFileLocation(uri, fullPath);
|
||||
}
|
||||
|
@ -60,7 +58,7 @@ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverte
|
|||
public String toInternalFormat(IIndexFileLocation location) {
|
||||
String result;
|
||||
if(location.getFullPath()!=null) {
|
||||
result = new Path(location.getFullPath()).removeFirstSegments(1).toString();
|
||||
result = new Path(location.getFullPath()).toString();
|
||||
} else {
|
||||
result = EXTERNAL+location.getURI().toString();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue