예제 #1
0
        protected override void Run()
        {
            IBuildTarget entry = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;

            DebugHandler.CheckResult cr = DebugHandler.CheckBeforeDebugging(entry);

            if (cr == DebugHandler.CheckResult.BuildBeforeRun)
            {
                IAsyncOperation op = IdeApp.ProjectOperations.Build(entry);
                op.Completed += delegate {
                    if (op.SuccessWithWarnings && !IdeApp.Preferences.RunWithWarnings)
                    {
                        return;
                    }
                    if (op.Success)
                    {
                        IdeApp.ProjectOperations.Debug(entry);
                    }
                };
            }
            else if (cr == DebugHandler.CheckResult.Run)
            {
                IdeApp.ProjectOperations.Debug(entry);
            }
        }
예제 #2
0
        protected override void Update(CommandInfo info)
        {
            info.Visible = true;

            if (!DebuggingService.IsDebuggingSupported || !DebuggingService.IsFeatureSupported(DebuggerFeatures.Breakpoints) || DebuggingService.Breakpoints.IsReadOnly)
            {
                info.Enabled = false;
                return;
            }

            var doc = IdeApp.Workbench.ActiveDocument;

            if (doc != null && doc.Editor != null && doc.FileName != FilePath.Null)
            {
                if (IdeApp.Workspace.IsOpen)
                {
                    var target = DebugHandler.GetRunTarget();

                    info.Enabled = target != null && IdeApp.ProjectOperations.CanDebug(target);
                }
                else
                {
                    info.Enabled = doc.IsBuildTarget && doc.CanDebug();
                }
            }
            else
            {
                info.Enabled = false;
            }
        }
        protected override void Run()
        {
            var doc = IdeApp.Workbench.ActiveDocument;

            if (DebuggingService.IsPaused)
            {
                DebuggingService.RunToCursor(doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);
                return;
            }

            var bp = new RunToCursorBreakpoint(doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);

            DebuggingService.Breakpoints.Add(bp);
            DebugHandler.BuildAndDebug();
        }
예제 #4
0
		protected override void Run ()
		{
			var doc = IdeApp.Workbench.ActiveDocument;

			if (DebuggingService.IsPaused) {
				DebuggingService.RunToCursor (doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);
				return;
			}

			if (IdeApp.Workspace.IsOpen) {
				var bp = new RunToCursorBreakpoint (doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);
				DebuggingService.Breakpoints.Add (bp);
				var target = DebugHandler.GetRunTarget ();
				if (target != null)
					IdeApp.ProjectOperations.Debug (target);
			}
		}
예제 #5
0
        protected override void Run()
        {
            var doc      = IdeApp.Workbench.ActiveDocument;
            var textView = doc.GetContent <ITextView> (true);

            var(caretLine, caretColumn) = textView.MDCaretLineAndColumn();
            if (DebuggingService.IsPaused)
            {
                DebuggingService.RunToCursor(doc.FileName, caretLine, caretColumn);
                return;
            }

            if (IdeApp.Workspace.IsOpen)
            {
                var bp = new RunToCursorBreakpoint(doc.FileName, caretLine, caretColumn);
                DebuggingService.Breakpoints.Add(bp);
                var target = DebugHandler.GetRunTarget();
                if (target != null)
                {
                    IdeApp.ProjectOperations.Debug(target);
                }
            }
        }