예제 #1
0
        // QuickInfo
        public string GetQuickInfo(int position)
        {
            var contextSpan = contextSpans.GetContextSpan(position);

            if (contextSpan?.Type == ContextType.Template)
            {
                var quickInfo = tokens.GetToken(position)?.QuickInfo;
                if (quickInfo != null && quickInfo.StartsWith("Item Parent"))
                {
                    var parent = contextSpan.ParentContext?.Name;
                    if (parent != null)
                    {
                        quickInfo = parent + quickInfo.Remove(0, 4);
                    }
                }

                return(quickInfo);
            }

            var error = errorTokens.FindTokens(position).FirstOrDefault();

            if (error != null)
            {
                return(error.QuickInfo);
            }

            var symbol = shadowClass.GetSymbol(position);

            if (symbol != null)
            {
                return(Identifier.FromSymbol(symbol).QuickInfo);
            }

            return(null);
        }
예제 #2
0
        // QuickInfo
        public string GetQuickInfo(int position)
        {
            var contextSpan = contextSpans.GetContextSpan(position);

            if (contextSpan?.Type == ContextType.Template)
            {
                return(tokens.GetToken(position)?.QuickInfo);
            }

            var error = errorTokens.FindTokens(position).FirstOrDefault();

            if (error != null)
            {
                return(error.QuickInfo);
            }

            var symbol = shadowClass.GetSymbol(position);

            if (symbol != null)
            {
                return(Identifier.FromSymbol(symbol).QuickInfo);
            }

            return(null);
        }