1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Adjusted selection of the most representative index file variant for

C/C++ editor.
This commit is contained in:
Sergey Prigogin 2014-05-16 11:10:53 -07:00
parent 62776c27d6
commit 80c32be4b6

View file

@ -915,8 +915,13 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
for (IIndexFile indexFile : index.getFiles(linkageID, ifl)) { for (IIndexFile indexFile : index.getFiles(linkageID, ifl)) {
int score= indexFile.getMacros().length * 2; int score= indexFile.getMacros().length * 2;
IIndexFile context= getParsedInContext(indexFile); IIndexFile context= getParsedInContext(indexFile);
if (isSourceFile(context, getCProject().getProject())) if (isSourceFile(context, getCProject().getProject())) {
if (indexFile.equals(context)) {
// The file is an independently indexed source - return it.
return new IIndexFile[] { indexFile, indexFile };
}
score++; score++;
}
if (score > bestScore) { if (score > bestScore) {
bestScore= score; bestScore= score;
best= indexFile; best= indexFile;