Merge from vscode fc10e26ea50f82cdd84e9141491357922e6f5fba (#4639)

This commit is contained in:
Anthony Dresser
2019-03-21 10:58:16 -07:00
committed by GitHub
parent 8298db7d13
commit b65ee5b42e
149 changed files with 1408 additions and 814 deletions

View File

@@ -97,7 +97,7 @@ export class CallStackView extends ViewletPanel {
dom.addClass(container, 'debug-call-stack');
const treeContainer = renderViewTree(container);
this.dataSource = new CallStackDataSource();
this.dataSource = new CallStackDataSource(this.debugService);
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, treeContainer, new CallStackDelegate(), [
new SessionsRenderer(),
new ThreadsRenderer(),
@@ -562,6 +562,8 @@ function isDeemphasized(frame: IStackFrame): boolean {
class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem> {
deemphasizedStackFramesToShow: IStackFrame[];
constructor(private debugService: IDebugService) { }
hasChildren(element: IDebugModel | CallStackItem): boolean {
return isDebugModel(element) || isDebugSession(element) || (element instanceof Thread && element.stopped);
}
@@ -573,13 +575,18 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
return Promise.resolve([]);
}
if (sessions.length > 1) {
return Promise.resolve(sessions);
return Promise.resolve(sessions.filter(s => !s.parentSession));
}
const threads = sessions[0].getAllThreads();
// Only show the threads in the call stack if there is more than 1 thread.
return threads.length === 1 ? this.getThreadChildren(<Thread>threads[0]) : Promise.resolve(threads);
} else if (isDebugSession(element)) {
const childSessions = this.debugService.getModel().getSessions().filter(s => s.parentSession === element);
if (childSessions.length) {
return Promise.resolve(childSessions);
}
return Promise.resolve(element.getAllThreads());
} else {
return this.getThreadChildren(<Thread>element);

View File

@@ -217,7 +217,15 @@ export class FocusSessionActionItem extends SelectActionItem {
private update() {
const session = this.debugService.getViewModel().focusedSession;
const sessions = this.getSessions();
const names = sessions.map(s => s.getLabel());
const names = sessions.map(s => {
const label = s.getLabel();
if (s.parentSession) {
// Indent child sessions so they look like children
return `\u00A0\u00A0${label}`;
}
return label;
});
this.setOptions(names.map(data => <ISelectOptionItem>{ text: data }), session ? sessions.indexOf(session) : undefined);
}

View File

@@ -516,6 +516,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this.exceptionWidget = this.instantiationService.createInstance(ExceptionWidget, this.editor, exceptionInfo);
this.exceptionWidget.show({ lineNumber, column }, 0);
this.editor.revealLine(lineNumber);
}
private closeExceptionWidget(): void {

View File

@@ -37,7 +37,6 @@ export class ExceptionWidget extends ZoneWidget {
this._applyTheme(themeService.getTheme());
this._disposables.push(themeService.onThemeChange(this._applyTheme.bind(this)));
this.create();
const onDidLayoutChangeScheduler = new RunOnceScheduler(() => this._doLayout(undefined, undefined), 50);
this._disposables.push(this.editor.onDidLayoutChange(() => onDidLayoutChangeScheduler.schedule()));

View File

@@ -39,11 +39,6 @@
border: 1px solid white;
}
.vs-dark .monaco-workbench .debug-action.start,
.hc-black .monaco-workbench .debug-action.start {
background: url('continue-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .debug-action.configure,
.hc-black .monaco-workbench .debug-action.configure {
background: url('configure-inverse.svg') center center no-repeat;

View File

@@ -24,7 +24,6 @@
.monaco-editor .zone-widget .zone-widget-container.exception-widget .stack-trace {
margin-top: 0.5em;
max-height: 500px;
}
.monaco-editor .zone-widget .zone-widget-container.exception-widget a {