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:
parent
62776c27d6
commit
80c32be4b6
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue