mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 521817 - Implement PDOMCPPAliasTemplate.update()
This ensures that if the target type of an alias template changes, the target type is updated in the index during an incremental index update, without requiring a full index rebuild. Change-Id: I8800e3c1701409276f8db64000499a5fa9caf6a9
This commit is contained in:
parent
39795a203a
commit
dfd7a7164c
1 changed files with 16 additions and 0 deletions
|
@ -14,6 +14,8 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
|||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPAliasTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
|
||||
|
@ -22,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTemplateParameter;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateTypeParameter;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
|
||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
|
||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
|
@ -55,12 +58,25 @@ class PDOMCPPAliasTemplate extends PDOMCPPBinding implements ICPPAliasTemplate,
|
|||
}
|
||||
|
||||
public void initData(IType aliasedType) {
|
||||
storeAliasedType(aliasedType);
|
||||
}
|
||||
|
||||
private void storeAliasedType(IType aliasedType) {
|
||||
try {
|
||||
getLinkage().storeType(record + ALIASED_TYPE, aliasedType);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(PDOMLinkage linkage, IBinding newBinding, IASTNode point) throws CoreException {
|
||||
if (!(newBinding instanceof ICPPAliasTemplate)) {
|
||||
return;
|
||||
}
|
||||
|
||||
storeAliasedType(((ICPPAliasTemplate) newBinding).getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNodeType() {
|
||||
|
|
Loading…
Add table
Reference in a new issue