Skip to content

Commit

Permalink
[debug] Save the dirty editor when starting launch config
Browse files Browse the repository at this point in the history
Fixes: #7938

Saves all the editors when starting to debug in Theia.

Signed-off-by: Anas Shahid <muhammad.shahid@ericsson.com>
  • Loading branch information
Anas Shahid authored and vince-fugnitto committed Jul 1, 2020
1 parent dfcfccc commit 64244a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/debug/src/browser/debug-session-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { DisposableCollection, Emitter, Event, MessageService, ProgressService, WaitUntilEvent } from '@theia/core';
import { LabelProvider } from '@theia/core/lib/browser';
import { LabelProvider, ApplicationShell } from '@theia/core/lib/browser';
import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
import URI from '@theia/core/lib/common/uri';
import { EditorManager } from '@theia/editor/lib/browser';
Expand Down Expand Up @@ -141,6 +141,9 @@ export class DebugSessionManager {
@inject(QuickOpenTask)
protected readonly quickOpenTask: QuickOpenTask;

@inject(ApplicationShell)
protected readonly shell: ApplicationShell;

protected debugTypeKey: ContextKey<string>;
protected inDebugModeKey: ContextKey<boolean>;

Expand All @@ -166,6 +169,7 @@ export class DebugSessionManager {
async start(options: DebugSessionOptions): Promise<DebugSession | undefined> {
return this.progressService.withProgress('Start...', 'debug', async () => {
try {
await this.shell.saveAll();
await this.fireWillStartDebugSession();
const resolved = await this.resolveConfiguration(options);

Expand Down

0 comments on commit 64244a5

Please sign in to comment.