Exemplo n.º 1
0
        internal static void AugmentQuickInfoWorker(QuickInfoSourceProvider provider, IQuickInfoSession session, ITextBuffer subjectBuffer, IVsTextView viewAdapter, ExpressionAnalysis exprAnalysis, System.Collections.Generic.IList <object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = exprAnalysis.Span;
            if (applicableToSpan == null || String.IsNullOrWhiteSpace(exprAnalysis.Expression))
            {
                return;
            }

            bool            first  = true;
            var             result = new StringBuilder();
            int             count  = 0;
            IAnalysisResult val    = exprAnalysis.Value;

            if (val != null)
            {
                DTE dte = (DTE)VSGeneroPackage.Instance.GetPackageService(typeof(DTE));
                if (dte.Debugger.CurrentMode != dbgDebugMode.dbgBreakMode ||
                    !val.CanGetValueFromDebugger)
                {
                    quickInfoContent.Add(val.Documentation);
                }
                else
                {
                    string qiText;
                    if (TryGetQuickInfoFromDebugger(session, applicableToSpan.GetSpan(subjectBuffer.CurrentSnapshot), viewAdapter, out qiText))
                    {
                        quickInfoContent.Add(qiText);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public QuickInfoSource(QuickInfoSourceProvider provider, ITextBuffer textBuffer)
        {
            var adapterFactory = VSGeneroPackage.ComponentModel.GetService <IVsEditorAdaptersFactoryService>();

            _textBuffer = textBuffer;
            IWpfTextView wpfTextView;

            if (textBuffer.Properties.TryGetProperty <IWpfTextView>(typeof(IWpfTextView), out wpfTextView))
            {
                _viewAdapter = adapterFactory.GetViewAdapter(wpfTextView);
            }
            _provider = provider;
        }