private VSCompletion GetVSCompletion(CompletionItem item, string displayText = null) { if (!CompletionItemMap.TryGetValue(item, out var value)) { value = new CustomCommitCompletion(CompletionPresenterSession, item); CompletionItemMap.Add(item, value); } value.DisplayText = displayText ?? item.DisplayText; return(value); }
private VSCompletion GetVSCompletion(CompletionItem item, string displayText = null) { VSCompletion value; if (!CompletionItemMap.TryGetValue(item, out value)) { value = new CustomCommitCompletion(CompletionPresenterSession, item, displayText); CompletionItemMap.Add(item, value); } return(value); }
private VSCompletion GetVSCompletion(RoslynCompletionItem item, string displayText = null) { if (!CompletionItemMap.TryGetValue(item, out var value)) { value = new CustomCommitCompletion(CompletionPresenterSession, item); CompletionItemMap.Add(item, value); } value.DisplayText = displayText ?? (item.DisplayTextPrefix + item.DisplayText + item.DisplayTextSuffix); _displayTextToItem[value.DisplayText] = item; return(value); }
private VSCompletion GetVSCompletion(PresentationItem item) { VSCompletion value; if (!_presentationItemMap.TryGetValue(item, out value)) { value = new CustomCommitCompletion( _completionPresenterSession, item); _presentationItemMap.Add(item, value); } return(value); }
private VSCompletion ConvertCompletionItem(CompletionItem item, string displayTextOpt = null) { VSCompletion value; if (!_completionItemMap.TryGetValue(item, out value)) { value = new CustomCommitCompletion( _completionPresenterSession, item, displayTextOpt ?? item.DisplayText); _completionItemMap.Add(item, value); } return(value); }
public CancellableContentControl(ToolTipProvider toolTipProvider, CustomCommitCompletion item) { Debug.Assert(_foregroundObject.IsForeground()); _toolTipProvider = toolTipProvider; // Set our content to be "..." initially. this.Content = toolTipProvider._defaultTextBlock; // Kick off the task to produce the new content. When it completes, call back on // the UI thread to update the display. var scheduler = TaskScheduler.FromCurrentSynchronizationContext(); item.GetDescriptionAsync(_cancellationTokenSource.Token) .ContinueWith(ProcessDescription, _cancellationTokenSource.Token, TaskContinuationOptions.OnlyOnRanToCompletion, scheduler); // If we get unloaded (i.e. the user scrolls down in the completion list and VS // dismisses the existing tooltip), then cancel the work we're doing this.Unloaded += (s, e) => _cancellationTokenSource.Cancel(); }
private VSCompletion ConvertCompletionItem(CompletionItem item, string displayTextOpt = null) { VSCompletion value; if (!_completionItemMap.TryGetValue(item, out value)) { value = new CustomCommitCompletion( _completionPresenterSession, item, displayTextOpt ?? item.DisplayText); _completionItemMap.Add(item, value); } return value; }
private VSCompletion GetVSCompletion(CompletionItem item, string displayText = null) { VSCompletion value; if (!CompletionItemMap.TryGetValue(item, out value)) { value = new CustomCommitCompletion(CompletionPresenterSession, item); CompletionItemMap.Add(item, value); } value.DisplayText = displayText ?? item.DisplayText; return value; }
private VSCompletion GetVSCompletion(PresentationItem item) { VSCompletion value; if (!PresentationItemMap.TryGetValue(item, out value)) { value = new CustomCommitCompletion( CompletionPresenterSession, item); PresentationItemMap.Add(item, value); } return value; }