Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] CElementInfo data lost in CElement

I assume you are caching ICElements from a working copy (IWorkingCopy). Those elements become invalid during a reconcile operation (when the file is modified in the editor).
You should use ICElements from the "original" ITranslationUnit if possible.

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Pavan V Ananth
Sent: Monday, February 23, 2009 1:15 PM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] CElementInfo data lost in CElement

I am querying and caching the project ICElements in my app. From time to time whenever a change is made to the project (in terms of changes to the CPP source), I see in the getelementInfo call of CElement that the CElementInfo is  null and hence a new CElementInfo object is created and returned. This new info object doesn't contain certain data I am looking for (like source info ).

How to get access to the newly created CElements? Or is there a way to update the info object contents correctly using a CDT utility?

Specifically speaking, I am looking at the IMethodDeclaration object and I see that fields like getSource, isStatic, isVirtual, etc do not reflect correct data whenever a change is made to the source.


Back to the top