Skip to content

Commit

Permalink
debug: do not listen on launch.json changes, re-read it before debug …
Browse files Browse the repository at this point in the history
…start

fixes #47021
  • Loading branch information
isidorn committed Apr 19, 2018
1 parent 4b74bb0 commit 1bf1b55
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/vs/workbench/parts/debug/electron-browser/debugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export class DebugService implements debug.IDebugService {
private debugType: IContextKey<string>;
private debugState: IContextKey<string>;
private breakpointsToSendOnResourceSaved: Set<string>;
private launchJsonChanged: boolean;
private firstSessionStart: boolean;
private skipRunningTask: boolean;
private previousState: debug.State;
Expand Down Expand Up @@ -698,7 +697,6 @@ export class DebugService implements debug.IDebugService {
this.allProcesses.clear();
this.model.getBreakpoints().forEach(bp => bp.verified = false);
}
this.launchJsonChanged = false;

let config: debug.IConfig, compound: debug.ICompound;
if (!configOrName) {
Expand Down Expand Up @@ -1081,12 +1079,9 @@ export class DebugService implements debug.IDebugService {

return new TPromise<void>((c, e) => {
setTimeout(() => {
// Read the configuration again if a launch.json has been changed, if not just use the inmemory configuration
let config = process.configuration;

const launch = process.session.root ? this.configurationManager.getLaunch(process.session.root.uri) : undefined;
if (this.launchJsonChanged && launch) {
this.launchJsonChanged = false;
if (launch) {
config = launch.getConfiguration(process.configuration.name) || config;
// Take the type from the process since the debug extension might overwrite it #21316
config.type = process.configuration.type;
Expand Down Expand Up @@ -1303,13 +1298,9 @@ export class DebugService implements debug.IDebugService {
}

fileChangesEvent.getUpdated().forEach(event => {

if (this.breakpointsToSendOnResourceSaved.delete(event.resource.toString())) {
this.sendBreakpoints(event.resource, true).done(null, errors.onUnexpectedError);
}
if (strings.endsWith(event.resource.toString(), '.vscode/launch.json')) {
this.launchJsonChanged = true;
}
});
}

Expand Down

0 comments on commit 1bf1b55

Please sign in to comment.