コード例 #1
0
ファイル: DebugAdapterLauncher.cs プロジェクト: zyxws012/PTVS
        private static void AddDebuggerOptions(IAdapterLaunchInfo adapterLaunchInfo, DebugInfo launchJson)
        {
            var debugService = (IPythonDebugOptionsService)Package.GetGlobalService(typeof(IPythonDebugOptionsService));

            // Stop on entry should always be true for VS Debug Adapter Host.
            // If stop on entry is disabled then VS will automatically issue
            // continue when it sees "stopped" event with "reason=entry".
            launchJson.StopOnEntry = true;

            launchJson.PromptBeforeRunningWithBuildError = debugService.PromptBeforeRunningWithBuildError;
            launchJson.RedirectOutput        = debugService.TeeStandardOutput;
            launchJson.WaitOnAbnormalExit    = debugService.WaitOnAbnormalExit;
            launchJson.WaitOnNormalExit      = debugService.WaitOnNormalExit;
            launchJson.BreakOnSystemExitZero = debugService.BreakOnSystemExitZero;
            launchJson.DebugStdLib           = debugService.DebugStdLib;
            launchJson.ShowReturnValue       = debugService.ShowFunctionReturnValue;

            PathRule excludePTVSInstallDirectory = new PathRule()
            {
                Path    = PathUtils.GetParent(typeof(DebugAdapterLauncher).Assembly.Location),
                Include = false,
            };

            launchJson.Rules = new List <PathRule>()
            {
                excludePTVSInstallDirectory
            };
        }
コード例 #2
0
        private static void AddDebuggerOptions(IAdapterLaunchInfo adapterLaunchInfo, DebugInfo launchJson)
        {
            var debugService = (IPythonDebugOptionsService)Package.GetGlobalService(typeof(IPythonDebugOptionsService));

            // Stop on entry should always be true for VS Debug Adapter Host.
            // If stop on entry is disabled then VS will automatically issue
            // continue when it sees "stopped" event with "reason=entry".
            launchJson.StopOnEntry = true;

            // Force this to false to prevent subprocess debugging, which we do not support yet in PTVS
            launchJson.SubProcess = false;

            launchJson.PromptBeforeRunningWithBuildError = debugService.PromptBeforeRunningWithBuildError;
            launchJson.RedirectOutput        = debugService.TeeStandardOutput;
            launchJson.WaitOnAbnormalExit    = debugService.WaitOnAbnormalExit;
            launchJson.WaitOnNormalExit      = debugService.WaitOnNormalExit;
            launchJson.BreakOnSystemExitZero = debugService.BreakOnSystemExitZero;
            launchJson.DebugStdLib           = debugService.DebugStdLib;
            launchJson.ShowReturnValue       = debugService.ShowFunctionReturnValue;

            try {
                var adapterLaunchInfoJson = JObject.Parse(adapterLaunchInfo.LaunchJson);
                AddVariablePresentationOptions(adapterLaunchInfoJson, launchJson);
            } catch (JsonReaderException) {
                // this should never happen
                Debug.Fail("adapterLaunchInfo is not valid json");
            }

            var excludePTVSInstallDirectory = new PathRule()
            {
                Path    = PathUtils.GetParent(typeof(DebugAdapterLauncher).Assembly.Location),
                Include = false,
            };

            launchJson.Rules = new List <PathRule>()
            {
                excludePTVSInstallDirectory
            };
        }
コード例 #3
0
        private static void AddDebuggerOptions(IAdapterLaunchInfo adapterLaunchInfo, DebugInfo launchJson)
        {
            var debugService = (IPythonDebugOptionsService)Package.GetGlobalService(typeof(IPythonDebugOptionsService));

            // Stop on entry should always be true for VS Debug Adapter Host.
            // If stop on entry is disabled then VS will automatically issue
            // continue when it sees "stopped" event with "reason=entry".
            launchJson.StopOnEntry = true;

            // Force this to false to prevent subprocess debugging, which we do not support yet in PTVS
            launchJson.SubProcess = false;

            launchJson.PromptBeforeRunningWithBuildError = debugService.PromptBeforeRunningWithBuildError;
            launchJson.RedirectOutput        = debugService.TeeStandardOutput;
            launchJson.WaitOnAbnormalExit    = debugService.WaitOnAbnormalExit;
            launchJson.WaitOnNormalExit      = debugService.WaitOnNormalExit;
            launchJson.BreakOnSystemExitZero = debugService.BreakOnSystemExitZero;
            launchJson.DebugStdLib           = debugService.DebugStdLib;
            launchJson.ShowReturnValue       = debugService.ShowFunctionReturnValue;

            var variablePresentation = new VariablePresentation();

            variablePresentation.Class      = debugService.VariablePresentationForClasses;
            variablePresentation.Function   = debugService.VariablePresentationForFunctions;
            variablePresentation.Protected  = debugService.VariablePresentationForProtected;
            variablePresentation.Special    = debugService.VariablePresentationForSpecial;
            launchJson.VariablePresentation = variablePresentation;

            var excludePTVSInstallDirectory = new PathRule()
            {
                Path    = PathUtils.GetParent(typeof(DebugAdapterLauncher).Assembly.Location),
                Include = false,
            };

            launchJson.Rules = new List <PathRule>()
            {
                excludePTVSInstallDirectory
            };
        }