mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
Follow up for bug 272815.
This commit is contained in:
parent
3bd59df377
commit
9f0fd1d199
6 changed files with 11 additions and 10 deletions
|
@ -304,7 +304,7 @@ public class CIndex implements IIndex {
|
||||||
for (int k= 0; k < includes.length; k++) {
|
for (int k= 0; k < includes.length; k++) {
|
||||||
IIndexInclude include = includes[k];
|
IIndexInclude include = includes[k];
|
||||||
IIndexFileLocation target= include.getIncludesLocation();
|
IIndexFileLocation target= include.getIncludesLocation();
|
||||||
Object key= target != null ? (Object) target : include.getName();
|
Object key= target != null ? (Object) target : include.getFullName();
|
||||||
if (handled.add(key)) {
|
if (handled.add(key)) {
|
||||||
out.add(include);
|
out.add(include);
|
||||||
if (depth != 0) {
|
if (depth != 0) {
|
||||||
|
|
|
@ -265,7 +265,9 @@ public class PDOMInclude implements IIndexFragmentInclude {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() throws CoreException {
|
public String getName() throws CoreException {
|
||||||
return getFullName().substring(fName.lastIndexOf('/') + 1);
|
final String fullName= getFullName();
|
||||||
|
final int idx= Math.max(fullName.lastIndexOf('/'), fullName.lastIndexOf('\\'));
|
||||||
|
return fullName.substring(idx + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void convertToUnresolved() throws CoreException {
|
public void convertToUnresolved() throws CoreException {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -314,7 +314,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
||||||
outputUnresolvedIncludes(index, out, indent, inc.getIncludesLocation(), linkageID, handled);
|
outputUnresolvedIncludes(index, out, indent, inc.getIncludesLocation(), linkageID, handled);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
out.println(indent + "Unresolved inclusion: " + inc.getName() + " in file " +
|
out.println(indent + "Unresolved inclusion: " + inc.getFullName() + " in file " +
|
||||||
inc.getIncludedByLocation().getURI());
|
inc.getIncludedByLocation().getURI());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -114,7 +114,7 @@ public class IBContentProvider extends AsyncTreeContentProvider {
|
||||||
else {
|
else {
|
||||||
IIndexFileLocation includesPath= include.getIncludesLocation();
|
IIndexFileLocation includesPath= include.getIncludesLocation();
|
||||||
if (includesPath == null) {
|
if (includesPath == null) {
|
||||||
targetFile= new IBFile(include.getName());
|
targetFile= new IBFile(include.getFullName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
targetFile= new IBFile(project, includesPath);
|
targetFile= new IBFile(project, includesPath);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -39,7 +39,7 @@ public class PDOMSearchUnresolvedIncludesQuery extends PDOMSearchQuery {
|
||||||
for (IIndexInclude include : file.getIncludes()) {
|
for (IIndexInclude include : file.getIncludes()) {
|
||||||
if (include.isActive() && !include.isResolved()) {
|
if (include.isActive() && !include.isResolved()) {
|
||||||
result.addMatch(new PDOMSearchMatch(new ProblemSearchElement(
|
result.addMatch(new PDOMSearchMatch(new ProblemSearchElement(
|
||||||
IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND, include.getName(),
|
IProblem.PREPROCESSOR_INCLUSION_NOT_FOUND, include.getFullName(),
|
||||||
include.getIncludedByLocation()),
|
include.getIncludedByLocation()),
|
||||||
include.getNameOffset(), include.getNameLength()));
|
include.getNameOffset(), include.getNameLength()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,6 @@ public class IndexUI {
|
||||||
for (int j=0; j<files.length; j++) {
|
for (int j=0; j<files.length; j++) {
|
||||||
IIndexFile file= files[j];
|
IIndexFile file= files[j];
|
||||||
String elementName= include.getElementName();
|
String elementName= include.getElementName();
|
||||||
elementName= elementName.substring(elementName.lastIndexOf('/')+1);
|
|
||||||
ISourceRange pos= include.getSourceRange();
|
ISourceRange pos= include.getSourceRange();
|
||||||
IRegion region= getConvertedRegion(tu, file, pos.getIdStartPos(), pos.getIdLength());
|
IRegion region= getConvertedRegion(tu, file, pos.getIdStartPos(), pos.getIdLength());
|
||||||
|
|
||||||
|
@ -256,7 +255,7 @@ public class IndexUI {
|
||||||
if (diff > bestDiff) {
|
if (diff > bestDiff) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (candidate.getName().endsWith(elementName)) {
|
if (candidate.getFullName().endsWith(elementName)) {
|
||||||
bestDiff= diff;
|
bestDiff= diff;
|
||||||
best= candidate;
|
best= candidate;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue