Beispiel #1
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            var viewPoint = CodeNavigator.FindCurrentItemDefinition(TextView, _textBuffer);

            if (viewPoint.HasValue)
            {
                TextView.Caret.MoveTo(new SnapshotPoint(TextView.TextBuffer.CurrentSnapshot, viewPoint.Value));
                TextView.Caret.EnsureVisible();
                return(CommandResult.Executed);
            }
            return(CommandResult.NotSupported);
        }
Beispiel #2
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            string itemName;
            var    viewPoint = CodeNavigator.FindCurrentItemDefinition(TextView, _textBuffer, out itemName);

            if (viewPoint.HasValue)
            {
                TextView.Caret.MoveTo(new SnapshotPoint(TextView.TextBuffer.CurrentSnapshot, viewPoint.Value));
                TextView.Caret.EnsureVisible();
            }
            else
            {
                // Try View(item) in case this is internal function
                _objectViewer?.ViewObjectDetails(_session, REnvironments.GlobalEnv, itemName, itemName).DoNotWait();
            }
            return(CommandResult.Executed);
        }