private static ICompletionExpression FindCompletion(ICompletionEvent cce) { var cf = new CompletionFinder(); cce.Context2.SST.Accept(cf, 0); return(cf.CompletionExpr); }
private static IMethodName GetSelectedMethodName(ICompletionEvent ce) { if (ce.LastSelectedProposal != null) { var proposalName = ce.LastSelectedProposal.Name; var m = proposalName as IMethodName; return(m); } return(null); }
private static IKaVEList <IProposalSelection> GetRebasedSelections(ICompletionEvent evt2, DateTime?oldBaseTime, DateTime?newBaseTime) { var rebaseOffset = newBaseTime - oldBaseTime; return(Lists.NewListFrom <IProposalSelection>( evt2.Selections.Select( selection => new ProposalSelection { Proposal = selection.Proposal, SelectedAfter = selection.SelectedAfter + rebaseOffset }))); }
public static void AddPrefix(this ICompletionEvent completionEvent, string newPrefix) { var methodDeclarationContainingCompletionExpression = new MethodDeclaration { Body = Lists.NewList <IStatement>( new ExpressionStatement { Expression = new CompletionExpression { Token = newPrefix } }) }; completionEvent.Context2.SST.Methods.Add(methodDeclarationContainingCompletionExpression); }
private bool IsMethodSelection(ICompletionEvent ce) { var sel = ce.LastSelectedProposal; return(sel != null && sel.Name is IMethodName); }