Exemple #1
0
        private static Hover ToHover(IReadOnlyList <IRFunctionQuickInfo> e, IEditorBuffer buffer)
        {
            if (e == null || e.Count == 0)
            {
                return(new Hover());
            }
            var info    = e[0];
            var content = info.Content?.FirstOrDefault();

            if (!string.IsNullOrEmpty(content))
            {
                var snapshot = buffer.CurrentSnapshot;
                var start    = info.ApplicableToRange.GetStartPoint(snapshot);
                var end      = info.ApplicableToRange.GetEndPoint(snapshot);
                return(new Hover {
                    Contents = content,
                    Range = buffer.ToLineRange(start, end)
                });
            }
            return(new Hover());
        }