コード例 #1
0
ファイル: RoslynCompletionSet.cs プロジェクト: zvinch/roslyn
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: RoslynCompletionSet.cs プロジェクト: rkrill/roslyn
        private VSCompletion GetVSCompletion(PresentationItem item)
        {
            VSCompletion value;

            if (!_presentationItemMap.TryGetValue(item, out value))
            {
                value = new CustomCommitCompletion(
                    _completionPresenterSession,
                    item);
                _presentationItemMap.Add(item, value);
            }

            return(value);
        }
コード例 #5
0
ファイル: CompletionSet2.cs プロジェクト: ruo2012/peachpie
        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);
        }
コード例 #6
0
            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();
            }
コード例 #7
0
        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;
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        private VSCompletion GetVSCompletion(PresentationItem item)
        {
            VSCompletion value;
            if (!PresentationItemMap.TryGetValue(item, out value))
            {
                value = new CustomCommitCompletion(
                    CompletionPresenterSession,
                    item);
                PresentationItemMap.Add(item, value);
            }

            return value;
        }