コード例 #1
0
        public ISignatureHelpSession TriggerSignatureHelp(VisualStudio.Text.Editor.ITextView textView)
        {
            ObservableCollection <ISignature> sets = new ObservableCollection <ISignature>();
            var session = new MockSignatureHelpSession(
                textView,
                sets,
                textView.TextBuffer.CurrentSnapshot.CreateTrackingPoint(
                    textView.Caret.Position.BufferPosition.Position,
                    PointTrackingMode.Negative
                    )
                );

            foreach (var provider in _sigProviders)
            {
                foreach (var targetContentType in provider.Metadata.ContentTypes)
                {
                    if (textView.TextBuffer.ContentType.IsOfType(targetContentType))
                    {
                        var source = provider.Value.TryCreateSignatureHelpSource(textView.TextBuffer);
                        if (source != null)
                        {
                            source.AugmentSignatureHelpSession(session, sets);
                        }
                    }
                }
            }

            if (session.Signatures.Count > 0 && !session.IsDismissed)
            {
                _stackMap.GetStackForTextView(textView).PushSession(session);
            }

            return(session);
        }
コード例 #2
0
        public ISignatureHelpSession TriggerSignatureHelp(VisualStudio.Text.Editor.ITextView textView) {
            ObservableCollection<ISignature> sets = new ObservableCollection<ISignature>();
            var session = new MockSignatureHelpSession(
                textView,
                sets,
                textView.TextBuffer.CurrentSnapshot.CreateTrackingPoint(
                    textView.Caret.Position.BufferPosition.Position,
                    PointTrackingMode.Negative
                )
            );

            foreach (var provider in _sigProviders) {
                foreach (var targetContentType in provider.Metadata.ContentTypes) {
                    if (textView.TextBuffer.ContentType.IsOfType(targetContentType)) {
                        var source = provider.Value.TryCreateSignatureHelpSource(textView.TextBuffer);
                        if (source != null) {
                            source.AugmentSignatureHelpSession(session, sets);
                        }
                    }
                }
            }

            if (session.Signatures.Count > 0 && !session.IsDismissed) {
                _stackMap.GetStackForTextView(textView).PushSession(session);
            }

            return session;
        }