mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Fix for 100598: DOM Indexer encodes weird things when indexing a CPP file in a C project. Fixed correlation between parser's parser language and indexer visitor.
This commit is contained in:
parent
229dce01a0
commit
b66ffc6cd2
3 changed files with 16 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
|||
2005-06-21 Vladimir Hirsl
|
||||
Fix for 100598: DOM Indexer encodes weird things when indexing a CPP file in a C project
|
||||
Fixed correlation between parser's parser language and indexer visitor.
|
||||
|
||||
* index/org/eclipse/cdt/internal/core/index/domsourceindexer/CGenerateIndexVisitor.java
|
||||
* index/org/eclipse/cdt/internal/core/index/domsourceindexer/DOMSoureIndexerRunner.java
|
||||
|
||||
2005-06-20 Vladimir Hirsl
|
||||
Completed optimization #2 in PR 91801: [Indexer] Optimize header file visiting/indexing
|
||||
Encountered headers are removed before instead of after indexing the whole project, thus
|
||||
|
|
|
@ -185,11 +185,14 @@ public class CGenerateIndexVisitor extends CASTVisitor {
|
|||
if (entryKind != IIndex.REFERENCE) {
|
||||
modifiers = IndexVisitorUtil.getModifiers(name, binding);
|
||||
}
|
||||
// guard against cpp entities in c project
|
||||
if (iEntryType != 0) {
|
||||
TypeEntry indexEntry = new TypeEntry(iEntryType, entryKind, qualifiedName, modifiers, fileNumber);
|
||||
indexEntry.setNameOffset(fileLoc.getNodeOffset(), fileLoc.getNodeLength(), IIndex.OFFSET);
|
||||
|
||||
indexEntry.serialize(indexer.getOutput());
|
||||
}
|
||||
}
|
||||
else if (binding instanceof IEnumeration){
|
||||
int modifiers = 0;
|
||||
if (entryKind != IIndex.REFERENCE) {
|
||||
|
|
|
@ -105,9 +105,6 @@ public class DOMSourceIndexerRunner extends AbstractIndexerRunner {
|
|||
// Add the name of the file to the index
|
||||
output.addIndexedFile(file.getFullPath().toString());
|
||||
|
||||
//C or CPP?
|
||||
ParserLanguage language = CoreModel.hasCCNature(resourceFile.getProject()) ?
|
||||
ParserLanguage.CPP : ParserLanguage.C;
|
||||
IASTTranslationUnit tu = null;
|
||||
long startTime = 0, parseTime = 0, endTime = 0;
|
||||
String error = null;
|
||||
|
@ -122,7 +119,8 @@ public class DOMSourceIndexerRunner extends AbstractIndexerRunner {
|
|||
parseTime = System.currentTimeMillis();
|
||||
|
||||
ASTVisitor visitor = null;
|
||||
if (language == ParserLanguage.CPP) {
|
||||
//C or CPP?
|
||||
if (tu.getParserLanguage() == ParserLanguage.CPP) {
|
||||
visitor = new CPPGenerateIndexVisitor(this);
|
||||
} else {
|
||||
visitor = new CGenerateIndexVisitor(this);
|
||||
|
|
Loading…
Add table
Reference in a new issue