Skip to main content

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

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> 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> 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
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top