Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Indexer not detecting any definitions(or occurences) in custom refactoring

Hey,
   One more question. Does the CPPClassType also contain the declarations in getDeclarations()? Somehow that is throwing me a null pointer exception.

Basically, I am trying to detect something like this


struct StructType{
...
}

StructType structObj;


I want to be able to query for the structObj declaration from a ClassType object which I have.

On Wed, Nov 25, 2015 at 10:20 PM, Krishna Narasimhan <krishna.nm86@xxxxxxxxx> wrote:
Nathan,
   This is awesome. Thanks a lot

Sergey,
       I will look into that. But for my current purpose, Nathans help worked. But I would like to learn the fundas about this binding. As I have bigger flow analysis coming up. 

On Wed, Nov 25, 2015 at 7:24 PM, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:
> What is the way to bind local variable names to their type definitions

The IBinding for the variable will be an IVariable, which has a getType() method.

> and also references?

To find references of a local variable, you need to search the AST rather than the index. You can do this with IASTTranslationUnit.getReferences(IBinding).

Regards,
Nate

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top