mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
Merge from vscode 8df646d3c5477b02737fc10343fa7cf0cc3f606b
This commit is contained in:
@@ -96,6 +96,7 @@ const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewE
|
||||
id: OpenDebugPanelAction.ID,
|
||||
keybindings: openPanelKb
|
||||
},
|
||||
order: 3,
|
||||
hideIfEmpty: true
|
||||
}, ViewContainerLocation.Panel);
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ export class DebugSession implements IDebugSession {
|
||||
|
||||
this.initialized = true;
|
||||
this._onDidChangeState.fire();
|
||||
this.model.setExceptionBreakpoints(this.raw!.capabilities.exceptionBreakpointFilters || []);
|
||||
this.model.setExceptionBreakpoints((this.raw && this.raw.capabilities.exceptionBreakpointFilters) || []);
|
||||
} catch (err) {
|
||||
this.initialized = true;
|
||||
this._onDidChangeState.fire();
|
||||
|
||||
@@ -208,9 +208,20 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
}));
|
||||
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('debug.console.lineHeight') || e.affectsConfiguration('debug.console.fontSize') || e.affectsConfiguration('debug.console.fontFamily')) {
|
||||
this.onDidFontChange();
|
||||
this.onDidStyleChange();
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.themeService.onDidColorThemeChange(e => {
|
||||
this.onDidStyleChange();
|
||||
}));
|
||||
|
||||
this._register(this.viewDescriptorService.onDidChangeLocation(e => {
|
||||
if (e.views.some(v => v.id === this.id)) {
|
||||
this.onDidStyleChange();
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.editorService.onDidActiveEditorChange(() => {
|
||||
this.setMode();
|
||||
}));
|
||||
@@ -253,14 +264,15 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
}
|
||||
}
|
||||
|
||||
private onDidFontChange(): void {
|
||||
private onDidStyleChange(): void {
|
||||
if (this.styleElement) {
|
||||
const debugConsole = this.configurationService.getValue<IDebugConfiguration>('debug').console;
|
||||
const fontSize = debugConsole.fontSize;
|
||||
const fontFamily = debugConsole.fontFamily === 'default' ? 'var(--monaco-monospace-font)' : debugConsole.fontFamily;
|
||||
const lineHeight = debugConsole.lineHeight ? `${debugConsole.lineHeight}px` : '1.4em';
|
||||
const backgroundColor = this.themeService.getColorTheme().getColor(this.getBackgroundColor());
|
||||
|
||||
// Set the font size, font family, line height and align the twistie to be centered
|
||||
// Set the font size, font family, line height and align the twistie to be centered, and input theme color
|
||||
this.styleElement.innerHTML = `
|
||||
.repl .repl-tree .expression {
|
||||
font-size: ${fontSize}px;
|
||||
@@ -274,6 +286,10 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
.repl .repl-tree .monaco-tl-twistie {
|
||||
background-position-y: calc(100% - ${fontSize * 1.4 / 2 - 8}px);
|
||||
}
|
||||
|
||||
.repl .repl-input-wrapper .monaco-editor .lines-content {
|
||||
background-color: ${backgroundColor};
|
||||
}
|
||||
`;
|
||||
|
||||
this.tree.rerender();
|
||||
@@ -510,7 +526,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
// Make sure to select the session if debugging is already active
|
||||
this.selectSession();
|
||||
this.styleElement = dom.createStyleSheet(this.container);
|
||||
this.onDidFontChange();
|
||||
this.onDidStyleChange();
|
||||
}
|
||||
|
||||
private createReplInput(container: HTMLElement): void {
|
||||
|
||||
@@ -80,8 +80,11 @@ export class VariablesView extends ViewPane {
|
||||
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]);
|
||||
if (scopes.every(s => this.tree.getNode(s).collapsed) && scopes.length > 0) {
|
||||
const toExpand = scopes.filter(s => !s.expensive).shift();
|
||||
if (toExpand) {
|
||||
this.tree.expand(toExpand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,9 +305,19 @@ export class StackFrame implements IStackFrame {
|
||||
getScopes(): Promise<IScope[]> {
|
||||
if (!this.scopes) {
|
||||
this.scopes = this.thread.session.scopes(this.frameId, this.thread.threadId).then(response => {
|
||||
return response && response.body && response.body.scopes ?
|
||||
response.body.scopes.map((rs, index) => new Scope(this, index, rs.name, rs.variablesReference, rs.expensive, rs.namedVariables, rs.indexedVariables,
|
||||
rs.line && rs.column && rs.endLine && rs.endColumn ? new Range(rs.line, rs.column, rs.endLine, rs.endColumn) : undefined)) : [];
|
||||
if (!response || !response.body || !response.body.scopes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const scopeNameIndexes = new Map<string, number>();
|
||||
return response.body.scopes.map(rs => {
|
||||
const previousIndex = scopeNameIndexes.get(rs.name);
|
||||
const index = typeof previousIndex === 'number' ? previousIndex + 1 : 0;
|
||||
scopeNameIndexes.set(rs.name, index);
|
||||
return new Scope(this, index, rs.name, rs.variablesReference, rs.expensive, rs.namedVariables, rs.indexedVariables,
|
||||
rs.line && rs.column && rs.endLine && rs.endColumn ? new Range(rs.line, rs.column, rs.endLine, rs.endColumn) : undefined);
|
||||
|
||||
});
|
||||
}, err => [new ErrorScope(this, 0, err.message)]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user