Example #1
0
        Expression FindUnderMousePointer(EnvDTE.Debugger debugger, MouseHoverEventArgs e)
        {
            var point = e.TextPosition.GetPoint(e.TextPosition.AnchorBuffer, PositionAffinity.Predecessor);
            if (!point.HasValue)
            {
                return null;
            }

            SnapshotSpan span;
            var name = GetVariableNameAndSpan(point.Value, out span);
            if (name == null)
            {
                return null;
            }

            var expression = debugger.GetExpression(name);
            if (!expression.IsValidValue)
            {
                return null;
            }
            return expression;
        }