当前位置: 首页>>代码示例>>C#>>正文


C# IQuickInfoSession.CreateTrackingSpan方法代码示例

本文整理汇总了C#中IQuickInfoSession.CreateTrackingSpan方法的典型用法代码示例。如果您正苦于以下问题:C# IQuickInfoSession.CreateTrackingSpan方法的具体用法?C# IQuickInfoSession.CreateTrackingSpan怎么用?C# IQuickInfoSession.CreateTrackingSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IQuickInfoSession的用法示例。


在下文中一共展示了IQuickInfoSession.CreateTrackingSpan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AnalyzeExpression

 private ExpressionAnalysis AnalyzeExpression(IQuickInfoSession session) {
     return VsProjectAnalyzer.AnalyzeExpression(
         _textBuffer.CurrentSnapshot,
         session.CreateTrackingSpan(_textBuffer),
         false
     );
 }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:QuickInfoSource.cs

示例2: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, System.Collections.Generic.IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            var textBuffer = session.TextView.TextBuffer;

            var vars = _provider._Analyzer.AnalyzeExpression(
                textBuffer.CurrentSnapshot,
                textBuffer,
                session.CreateTrackingSpan(textBuffer)
            );

            applicableToSpan = vars.Span;
            if (String.IsNullOrEmpty(vars.Expression)) {
                return;
            }

            bool first = true;
            var result = new StringBuilder();
            int count = 0;
            List<IAnalysisValue> listVars = new List<IAnalysisValue>(vars.Values);
            HashSet<string> descriptions = new HashSet<string>();
            bool multiline = false;
            foreach (var v in listVars) {
                string description = null;
                if (listVars.Count == 1) {
                    if (v.Description != null) {
                        description = v.Description;
                    }
                } else {
                    if (v.ShortDescription != null) {
                        description = v.ShortDescription;
                    }
                }

                if (descriptions.Add(description)) {
                    if (first) {
                        first = false;
                    } else {
                        if (result.Length == 0 || result[result.Length - 1] != '\n') {
                            result.Append(", ");
                        } else {
                            multiline = true;
                        }
                    }
                    result.Append(description);
                    count++;
                }
            }

            if (multiline) {
                result.Insert(0, vars.Expression + ": " + Environment.NewLine);
            } else {
                result.Insert(0, vars.Expression + ": ");
            }

            quickInfoContent.Add(result.ToString());
        }
开发者ID:TerabyteX,项目名称:main,代码行数:56,代码来源:QuickInfoSource.cs

示例3: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, System.Collections.Generic.IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            if (_curSession != null && !_curSession.IsDismissed) {
                _curSession.Dismiss();
                _curSession = null;
            }

            _curSession = session;
            _curSession.Dismissed += CurSessionDismissed;

            var vars = _textBuffer.CurrentSnapshot.AnalyzeExpression(
                session.CreateTrackingSpan(_textBuffer),
                false
            );

            AugmentQuickInfoWorker(vars, quickInfoContent, out applicableToSpan);
        }
开发者ID:borota,项目名称:JTVS,代码行数:17,代码来源:QuickInfoSource.cs


注:本文中的IQuickInfoSession.CreateTrackingSpan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。