Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Enumeration facility

I have my own editor DOTEditor that extends CEditor. It has its own
SourceViewerConfiguration and CompletionProcessor but both extend CDT
counterparts. This is only to add some more custom facilities to the
existing CDT.

One of the custom thing is to add code assist facility for enumeration
parameters. When a method/function is being written and if the parameter
being typed is of type enumeration and uses says CTRL+SPACE, then I have fix
to fetch the list of values for a database.

This is what I have done in the custom completion processor

public class TMECompletionProcessor  extends CCompletionProcessor

 public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int documentOffset) 
        //Get the proposals from CDT
	ICCompletionProposal[] results = null;
        //Now add my list of proposals
        //I am getting completion node through which I can get the details
        IASTCompletionNode completionNode = getCurrentCompletionNode();
        //I get completionNode.Kind and it gives
CompletionKind.FUNCTION_REFERENCE when filling parameters in function calls
        if(kind == CompletionKind.FUNCTION_REFERENCE)
          //Here in which I want to identify which parameter the user is at
          //How to get this. CDT people pls. help

This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.

Back to the top