Beispiel #1
0
        private Task <ICommandResponse <ContinueToLocationCommand> > ContinueToLocationCommand(ContinueToLocationCommand arg)
        {
            this.BreakOn = GetClosetBreakPoint(
                this.ScriptsById[arg.Location.ScriptId],
                arg.Location.LineNumber,
                arg.Location.ColumnNumber);

            Continue();

            return(Task.FromResult <ICommandResponse <ContinueToLocationCommand> >(new ContinueToLocationCommandResponse()));
        }
Beispiel #2
0
        private BreakableScriptPoint GetClosetBreakPoint(ScriptInfo script, long lineNumber, long?columnNumber)
        {
            BreakableScriptPoint closestBreakpoint = null;
            var closestLineDistance   = long.MaxValue;
            var closestColumnDistance = long.MaxValue;

            foreach (var breakPoint in script.BreakableScriptPoint.Values)
            {
                var currentLineDistance   = Math.Abs(breakPoint.Info.lineNumber - lineNumber);
                var currentColumnDistance = columnNumber.HasValue ? Math.Abs(breakPoint.Info.columnNumber - columnNumber.Value) : breakPoint.Info.columnNumber;
                if (currentLineDistance < closestLineDistance ||
                    (currentLineDistance == closestLineDistance && currentColumnDistance < closestColumnDistance))
                {
                    closestBreakpoint     = breakPoint;
                    closestLineDistance   = currentLineDistance;
                    closestColumnDistance = currentColumnDistance;
                }
            }

            return(closestBreakpoint);
        }
Beispiel #3
0
 private Task <ICommandResponse <StepOverCommand> > StepOverCommand(StepOverCommand arg)
 {
     this.BreakOn = BreakableScriptPoint.Any;
     Continue();
     return(Task.FromResult <ICommandResponse <StepOverCommand> >(new StepOverCommandResponse()));
 }
Beispiel #4
0
        private Task <ICommandResponse <PauseCommand> > PauseCommand(PauseCommand arg)
        {
            this.BreakOn = BreakableScriptPoint.Any;

            return(Task.FromResult <ICommandResponse <PauseCommand> >(new PauseCommandResponse()));
        }