コード例 #1
0
ファイル: SanityCheck.cs プロジェクト: NicoSB/feedbag
        private static ICompletionExpression FindCompletion(ICompletionEvent cce)
        {
            var cf = new CompletionFinder();

            cce.Context2.SST.Accept(cf, 0);
            return(cf.CompletionExpr);
        }
コード例 #2
0
 private static IMethodName GetSelectedMethodName(ICompletionEvent ce)
 {
     if (ce.LastSelectedProposal != null)
     {
         var proposalName = ce.LastSelectedProposal.Name;
         var m            = proposalName as IMethodName;
         return(m);
     }
     return(null);
 }
コード例 #3
0
        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
            })));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: SanityCheck.cs プロジェクト: NicoSB/feedbag
        private bool IsMethodSelection(ICompletionEvent ce)
        {
            var sel = ce.LastSelectedProposal;

            return(sel != null && sel.Name is IMethodName);
        }