Example #1
0
        public void Dispose()
        {
            _editorSession.DebugService.DebuggerStopped -= OnDebugStopped;
            _editorSession.DebugService.Abort();

            _editorSession.Dispose();
        }
        protected void Stop()
        {
            Logger.Write(LogLevel.Normal, "Debug adapter is shutting down...");

            if (_editorSession != null)
            {
                _editorSession.PowerShellContext.RunspaceChanged -= powerShellContext_RunspaceChangedAsync;
                _editorSession.DebugService.DebuggerStopped      -= DebugService_DebuggerStoppedAsync;
                _editorSession.PowerShellContext.DebuggerResumed -= powerShellContext_DebuggerResumedAsync;

                if (_ownsEditorSession)
                {
                    _editorSession.Dispose();
                }

                _editorSession = null;
            }

            OnSessionEnded();
        }