Пример #1
0
        private void CreateCompletionListBuilder(
            RoslynCompletionItem selectedItem,
            RoslynCompletionItem suggestionModeItem,
            bool suggestionMode)
        {
            try
            {
                WritableCompletionBuilders.BeginBulkOperation();
                WritableCompletionBuilders.Clear();

                if (suggestionMode)
                {
                    var applicableToText = ApplicableTo.GetText(
                        ApplicableTo.TextBuffer.CurrentSnapshot);

                    var text         = applicableToText.Length > 0 ? applicableToText : suggestionModeItem.DisplayText;
                    var vsCompletion = GetVSCompletion(suggestionModeItem, text);

                    WritableCompletionBuilders.Add(vsCompletion);
                }
            }
            finally
            {
                WritableCompletionBuilders.EndBulkOperation();
            }
        }
Пример #2
0
 private void UpdateBuilders(IEnumerable <CompletionItem> items)
 {
     WritableCompletionBuilders.BeginBulkOperation();
     try
     {
         WritableCompletionBuilders.Clear();
         WritableCompletionBuilders.AddRange(ToCompletions(items));
     }
     finally
     {
         WritableCompletionBuilders.EndBulkOperation();
     }
 }