Exemple #1
0
        /// <summary>
        /// Determine which pieces of Quickinfo content should be displayed
        /// </summary>
        public void AugmentQuickInfoSession(IQuickInfoSession session, IList <object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (_disposed)
            {
                throw new ObjectDisposedException("QuickInfoSource");
            }

            var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(_buffer.CurrentSnapshot);

            if (triggerPoint == null)
            {
                return;
            }

            foreach (IMappingTagSpan <NM_TokenTag> curTag in _aggregator.GetTags(new SnapshotSpan(triggerPoint, triggerPoint)))
            {
                if (curTag.Tag.type == NM_TokenTypes.NM_data_registers)
                {
                    var    tagSpan     = curTag.Span.GetSpans(_buffer).First();
                    string key         = tagSpan.GetText().ToLower();
                    var    explanation = Dictionary_QuickInfo.GetDescription(key);
                    if (explanation.Length > 0)
                    {
                        applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);
                        quickInfoContent.Add(explanation);
                    }
                }
            }
        }
Exemple #2
0
        private string GetExplanation(string key)
        {
            var explanation = Dictionary_QuickInfo.GetDescription(key.ToLower());

            if (explanation.Length > 0)
            {
                return(explanation);
            }
            return(null);
        }