Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -25,7 +25,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { Emitter } from 'vs/base/common/event';
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
import { IAsyncDataTreeViewState } from 'vs/base/browser/ui/tree/asyncDataTree';
import { onUnexpectedError } from 'vs/base/common/errors';
import { FuzzyScore, createMatches } from 'vs/base/common/filters';
import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@@ -57,28 +56,27 @@ export class VariablesView extends ViewletPanel {
super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService, configurationService, contextKeyService);
// Use scheduler to prevent unnecessary flashing
this.onFocusStackFrameScheduler = new RunOnceScheduler(() => {
this.onFocusStackFrameScheduler = new RunOnceScheduler(async () => {
const stackFrame = this.debugService.getViewModel().focusedStackFrame;
this.needsRefresh = false;
if (stackFrame && this.savedViewState) {
this.tree.setInput(this.debugService.getViewModel(), this.savedViewState).then(null, onUnexpectedError);
await this.tree.setInput(this.debugService.getViewModel(), this.savedViewState);
this.savedViewState = undefined;
} else {
if (!stackFrame) {
// We have no stackFrame, save tree state before it is cleared
this.savedViewState = this.tree.getViewState();
}
this.tree.updateChildren().then(() => {
if (stackFrame) {
stackFrame.getScopes().then(scopes => {
// Expand the first scope if it is not expensive and if there is no expansion state (all are collapsed)
if (scopes.every(s => this.tree.getNode(s).collapsed) && scopes.length > 0 && !scopes[0].expensive) {
this.tree.expand(scopes[0]).then(undefined, onUnexpectedError);
}
});
await this.tree.updateChildren();
if (stackFrame) {
const scopes = await stackFrame.getScopes();
// Expand the first scope if it is not expensive and if there is no expansion state (all are collapsed)
if (scopes.every(s => this.tree.getNode(s).collapsed) && scopes.length > 0 && !scopes[0].expensive) {
this.tree.expand(scopes[0]);
}
}, onUnexpectedError);
}
}
}, 400);
}
@@ -96,12 +94,14 @@ export class VariablesView extends ViewletPanel {
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IExpression | IScope) => e }
});
this.tree.setInput(this.debugService.getViewModel()).then(null, onUnexpectedError);
this.tree.setInput(this.debugService.getViewModel());
CONTEXT_VARIABLES_FOCUSED.bindTo(this.tree.contextKeyService);
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action collapse-explorer');
this.toolbar.setActions([collapseAction])();
if (this.toolbar) {
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action collapse-explorer');
this.toolbar.setActions([collapseAction])();
}
this.tree.updateChildren();
this._register(this.debugService.getViewModel().onDidFocusStackFrame(sf => {