Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Refactoring binding question

You have to look the index before making calls to the index. Because objects 
returned by the index become invalid when the indexer writes to the index. 

Locking the index will give you better performace for loading the translation 
unit because the parser will skip indexed header files. 

Emanuel

On Monday 29 September 2008, Thomas Ball wrote:
> Found it -- if your refactoring runner locks the index before running (like
> ExtractConstantRefactoringRunner does), then bindings use the Composite
> versions.  Running my refactoring without locking the index (like
> ExtractFunctionRefactoringRunner does) fixes my immediate issue.
>
> On a more general note, when should CRefactoring.lockIndex() be used?  I
> locked it because my refactoring defines a new variable and so (I assume)
> modifies the index.  So does ExtractFunctionRefactoring, however, without
> any apparent problems.
>
> Tom
>
> On Sun, Sep 28, 2008 at 9:24 AM, Sergey Prigogin
> <eclipse.sprigogin@xxxxxxxxx<mailto:eclipse.sprigogin@xxxxxxxxx>> wrote:
> CompositeCPPFunction is an index binding (see the comment at the top of
> CompositeIndexBinding). CPPFunction is a binding from AST. I don't know why
> isGloballyQualified is not implemented for most index bindings.
>
> -sergey
>
> On Fri, Sep 26, 2008 at 12:19 PM, Thomas Ball
> <tball@xxxxxxxxxx<mailto:tball@xxxxxxxxxx>> wrote: My refactoring needs to
> lookup a function declaration binding from a call to it, so it uses a
> NodeContainer.findAllNames() method to resolve the function call's name. 
> The name's binding is a CompositeCPPFunction, but when the
> ExtractFunctionRefactoring runs the same code, it gets a CPPFunction for
> the same selection in the same file.  I can't figure out what's different
> between the two refactorings (both lookups are done in
> checkInitialConditions(), so there hasn't been much setup yet).  What is
> the difference between a CompositeCPPFunction and a CPPFunction?  The
> difference matters because the PDOM support for
> CompositeCPPBinding.isGloballyQualified() isn't implemented.
>
> Any help would be appreciated.
>
> Tom
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx<mailto:cdt-dev@xxxxxxxxxxx>
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx<mailto:cdt-dev@xxxxxxxxxxx>
> https://dev.eclipse.org/mailman/listinfo/cdt-dev



-- 
Emanuel Graf   Dipl. Ing FH
Institut für Software - http://ifs.hsr.ch - +41 55 222 4622
HSR Hochschule für Technik Rapperswil
Oberseestr 10, Postfach 1475, CH-8640 Rapperswil


Back to the top