Skip to content

Persist temp console debug session #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/features/DebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient";
import { IFeature } from "../feature";
import { getPlatformDetails, IPlatformDetails, OperatingSystem } from "../platform";
import { PowerShellProcess} from "../process";
import { SessionManager } from "../session";
import Settings = require("../settings");
import utils = require("../utils");
Expand All @@ -19,6 +20,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
private sessionCount: number = 1;
private command: vscode.Disposable;
private examplesPath: string;
private tempDebugProcess: PowerShellProcess;

constructor(context: ExtensionContext, private sessionManager: SessionManager) {
// Register a debug configuration provider
Expand Down Expand Up @@ -145,12 +147,16 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
const sessionFilePath = utils.getDebugSessionFilePath();

if (createNewIntegratedConsole) {
const debugProcess =
if (this.tempDebugProcess) {
this.tempDebugProcess.dispose();
}

this.tempDebugProcess =
this.sessionManager.createDebugSessionProcess(
sessionFilePath,
settings);

debugProcess
this.tempDebugProcess
.start(`DebugSession-${this.sessionCount++}`)
.then((sessionDetails) => {
utils.writeSessionFile(sessionFilePath, sessionDetails);
Expand Down