Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] name resolution and index bindings

Hi Sergey,

> Composite bindings are just wrappers around PDOM bindings. They are  
> used in situations when the index may consist of multiple fragments,  
> i.e. when there are multiple projects with dependencies between them. A  
> composite binding contains a reference to the corresponding PDOM  
> bindings and a reference to the index it belongs to. The index  
> reference cannot be derived from the PDOM binding itself since the same  
> PDOM may participate in more than one index. For example, if project A  
> depends on project B, the B's PDOM may participate in an index  
> containing just that PDOM, or the index that contains both, A's and B's  
> PDOMs. 

Interesting. I didn't know any of that. Doesn't this sharing of PDOMs
between two projects only work if the projects have identical settings
(includes, macros, etc.), though?

Is there a document somewhere that describes the design of the index? 
I would find it very instructive.

> It should be possible to improve declaredBefore by checking if the  
> index binding is declared in any of the included headers (see  
> CPPSemantics.isReachableFromAst(IASTTranslationUnit, IBinding)) and, if  
> not, using IASTTranslationUnit.getDeclarationsInAST(IBinding) to get  
> declarations in the current translation unit.

Great! I will give it a try.

Thanks for your help!

Nate 		 	   		  

Back to the top