Skip to content

Commit

Permalink
debug: set state to initalizing asap
Browse files Browse the repository at this point in the history
fixes #4032
  • Loading branch information
isidorn committed Mar 24, 2016
1 parent 8081b5b commit 52fe1e1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}

public createSession(noDebug: boolean, changeViewState = !this.partService.isSideBarHidden()): TPromise<any> {
this.setStateAndEmit(debug.State.Initializing);
this.clearReplExpressions();

return this.textFileService.saveAll().then(() => this.extensionService.onReady()).then(() => this.setConfiguration(this.configurationManager.getConfigurationName())).then(() => {
Expand Down Expand Up @@ -595,7 +596,6 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return TPromise.wrapError(new Error(nls.localize('debugAdapterCrash', "Debug adapter process has terminated unexpectedly")));
}

this.setStateAndEmit(debug.State.Initializing);
this.model.setExceptionBreakpoints(this.session.capabilities.exceptionBreakpointFilters);
return configuration.request === 'attach' ? this.session.attach(configuration) : this.session.launch(configuration);
}).then((result: DebugProtocol.Response) => {
Expand Down Expand Up @@ -676,6 +676,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}

const configuration = this.configurationManager.getConfiguration();
this.setStateAndEmit(debug.State.Initializing);
return this.doCreateSession({
type: configuration.type,
request: 'attach',
Expand Down

0 comments on commit 52fe1e1

Please sign in to comment.