Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)

This commit is contained in:
Anthony Dresser
2019-08-21 20:44:59 -07:00
committed by GitHub
parent d2ae0f0154
commit 985bfae8a0
107 changed files with 2260 additions and 814 deletions

View File

@@ -593,13 +593,13 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
return isDebugModel(element) || isDebugSession(element) || (element instanceof Thread && element.stopped);
}
getChildren(element: IDebugModel | CallStackItem): Promise<CallStackItem[]> {
async getChildren(element: IDebugModel | CallStackItem): Promise<CallStackItem[]> {
if (isDebugModel(element)) {
const sessions = element.getSessions();
if (sessions.length === 0) {
return Promise.resolve([]);
}
if (sessions.length > 1 || this.debugService.getViewModel().isMultiSessionView()) {
if (sessions.length > 1) {
return Promise.resolve(sessions.filter(s => !s.parentSession));
}
@@ -609,9 +609,10 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
} else if (isDebugSession(element)) {
const childSessions = this.debugService.getModel().getSessions().filter(s => s.parentSession === element);
const threads: CallStackItem[] = element.getAllThreads();
if (threads.length === 1 && childSessions.length === 0) {
if (threads.length === 1) {
// Do not show thread when there is only one to be compact.
return this.getThreadChildren(<Thread>threads[0]);
const children = await this.getThreadChildren(<Thread>threads[0]);
return children.concat(childSessions);
}
return Promise.resolve(threads.concat(childSessions));

View File

@@ -245,6 +245,9 @@ export class DebugHoverWidget implements IContentWidget {
this.layoutTreeAndContainer();
this.editor.layoutContentWidget(this);
this.scrollbar.scanDomNode();
this.tree.scrollTop = 0;
this.tree.scrollLeft = 0;
if (focus) {
this.editor.render();
this.tree.domFocus();

View File

@@ -479,11 +479,11 @@ export class DebugService implements IDebugService {
});
}
private launchOrAttachToSession(session: IDebugSession, focus = true): Promise<void> {
private launchOrAttachToSession(session: IDebugSession, forceFocus = false): Promise<void> {
const dbgr = this.configurationManager.getDebugger(session.configuration.type);
return session.initialize(dbgr!).then(() => {
return session.launchOrAttach(session.configuration).then(() => {
if (focus) {
if (forceFocus || !this.viewModel.focusedSession) {
this.focusStackFrame(undefined, undefined, session);
}
});
@@ -572,7 +572,7 @@ export class DebugService implements IDebugService {
return runTasks().then(taskResult => taskResult === TaskRunResult.Success ? this.extensionHostDebugService.reload(session.getId()) : undefined);
}
const shouldFocus = this.viewModel.focusedSession && session.getId() === this.viewModel.focusedSession.getId();
const shouldFocus = !!this.viewModel.focusedSession && session.getId() === this.viewModel.focusedSession.getId();
// If the restart is automatic -> disconnect, otherwise -> terminate #55064
return (isAutoRestart ? session.disconnect(true) : session.terminate(true)).then(() => {

View File

@@ -131,6 +131,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution {
private registerListeners(): void {
this._register(this.debugService.onDidChangeState(() => this.updateScheduler.schedule()));
this._register(this.debugService.getViewModel().onDidFocusSession(() => this.updateScheduler.schedule()));
this._register(this.debugService.onDidNewSession(() => this.updateScheduler.schedule()));
this._register(this.configurationService.onDidChangeConfiguration(e => this.onDidConfigurationChange(e)));
this._register(this.actionBar.actionRunner.onDidRun((e: IRunEvent) => {
// check for error