mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 708b019bb4e20f07cf89df9f1d943af3d38d7a70 (#9657)
This commit is contained in:
@@ -28,16 +28,18 @@ import { ResourceNavigator, WorkbenchAsyncDataTree } from 'vs/platform/list/brow
|
||||
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
||||
import { createMatches, FuzzyScore } from 'vs/base/common/filters';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { dispose } from 'vs/base/common/lifecycle';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { isSessionAttach } from 'vs/workbench/contrib/debug/common/debugUtils';
|
||||
import { STOP_ID, STOP_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, RESTART_SESSION_ID, RESTART_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, PAUSE_ID, PAUSE_LABEL, CONTINUE_ID, CONTINUE_LABEL } from 'vs/workbench/contrib/debug/browser/debugCommands';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { CollapseAction } from 'vs/workbench/browser/viewlet';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { textLinkForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { attachStylerCallback } from 'vs/platform/theme/common/styler';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -170,8 +172,8 @@ export class CallStackView extends ViewPane {
|
||||
new ThreadsRenderer(this.instantiationService),
|
||||
this.instantiationService.createInstance(StackFramesRenderer),
|
||||
new ErrorsRenderer(),
|
||||
new LoadMoreRenderer(),
|
||||
new ShowMoreRenderer()
|
||||
new LoadMoreRenderer(this.themeService),
|
||||
new ShowMoreRenderer(this.themeService)
|
||||
], this.dataSource, {
|
||||
accessibilityProvider: new CallStackAccessibilityProvider(),
|
||||
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'callStackAriaLabel' }, "Debug Call Stack"),
|
||||
@@ -408,6 +410,7 @@ interface IErrorTemplateData {
|
||||
|
||||
interface ILabelTemplateData {
|
||||
label: HTMLElement;
|
||||
toDispose: IDisposable;
|
||||
}
|
||||
|
||||
interface IStackFrameTemplateData {
|
||||
@@ -433,6 +436,7 @@ class SessionsRenderer implements ITreeRenderer<IDebugSession, FuzzyScore, ISess
|
||||
|
||||
renderTemplate(container: HTMLElement): ISessionTemplateData {
|
||||
const session = dom.append(container, $('.session'));
|
||||
dom.append(session, $('.codicon.codicon-bug'));
|
||||
const name = dom.append(session, $('.name'));
|
||||
const state = dom.append(session, $('.state'));
|
||||
const stateLabel = dom.append(state, $('span.label'));
|
||||
@@ -594,14 +598,21 @@ class LoadMoreRenderer implements ITreeRenderer<ThreadAndSessionIds, FuzzyScore,
|
||||
static readonly ID = 'loadMore';
|
||||
static readonly LABEL = nls.localize('loadMoreStackFrames', "Load More Stack Frames");
|
||||
|
||||
constructor(private readonly themeService: IThemeService) { }
|
||||
|
||||
get templateId(): string {
|
||||
return LoadMoreRenderer.ID;
|
||||
}
|
||||
|
||||
renderTemplate(container: HTMLElement): IErrorTemplateData {
|
||||
renderTemplate(container: HTMLElement): ILabelTemplateData {
|
||||
const label = dom.append(container, $('.load-more'));
|
||||
const toDispose = attachStylerCallback(this.themeService, { textLinkForeground }, colors => {
|
||||
if (colors.textLinkForeground) {
|
||||
label.style.color = colors.textLinkForeground.toString();
|
||||
}
|
||||
});
|
||||
|
||||
return { label };
|
||||
return { label, toDispose };
|
||||
}
|
||||
|
||||
renderElement(element: ITreeNode<ThreadAndSessionIds, FuzzyScore>, index: number, data: ILabelTemplateData): void {
|
||||
@@ -609,21 +620,29 @@ class LoadMoreRenderer implements ITreeRenderer<ThreadAndSessionIds, FuzzyScore,
|
||||
}
|
||||
|
||||
disposeTemplate(templateData: ILabelTemplateData): void {
|
||||
// noop
|
||||
templateData.toDispose.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
class ShowMoreRenderer implements ITreeRenderer<IStackFrame[], FuzzyScore, ILabelTemplateData> {
|
||||
static readonly ID = 'showMore';
|
||||
|
||||
constructor(private readonly themeService: IThemeService) { }
|
||||
|
||||
|
||||
get templateId(): string {
|
||||
return ShowMoreRenderer.ID;
|
||||
}
|
||||
|
||||
renderTemplate(container: HTMLElement): IErrorTemplateData {
|
||||
renderTemplate(container: HTMLElement): ILabelTemplateData {
|
||||
const label = dom.append(container, $('.show-more'));
|
||||
const toDispose = attachStylerCallback(this.themeService, { textLinkForeground }, colors => {
|
||||
if (colors.textLinkForeground) {
|
||||
label.style.color = colors.textLinkForeground.toString();
|
||||
}
|
||||
});
|
||||
|
||||
return { label };
|
||||
return { label, toDispose };
|
||||
}
|
||||
|
||||
renderElement(element: ITreeNode<IStackFrame[], FuzzyScore>, index: number, data: ILabelTemplateData): void {
|
||||
@@ -636,18 +655,20 @@ class ShowMoreRenderer implements ITreeRenderer<IStackFrame[], FuzzyScore, ILabe
|
||||
}
|
||||
|
||||
disposeTemplate(templateData: ILabelTemplateData): void {
|
||||
// noop
|
||||
templateData.toDispose.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
class CallStackDelegate implements IListVirtualDelegate<CallStackItem> {
|
||||
|
||||
getHeight(element: CallStackItem): number {
|
||||
if (element instanceof StackFrame) {
|
||||
if (!element.source || !element.source.available || isDeemphasized(element)) {
|
||||
return 12;
|
||||
}
|
||||
if (element instanceof StackFrame && element.presentationHint === 'label') {
|
||||
return 12;
|
||||
}
|
||||
if (element instanceof ThreadAndSessionIds || element instanceof Array) {
|
||||
return 12;
|
||||
}
|
||||
|
||||
return 22;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ export class DebugSession implements IDebugSession {
|
||||
|
||||
private readonly _onDidLoadedSource = new Emitter<LoadedSourceEvent>();
|
||||
private readonly _onDidCustomEvent = new Emitter<DebugProtocol.Event>();
|
||||
private readonly _onDidProgressStart = new Emitter<DebugProtocol.ProgressStartEvent>();
|
||||
private readonly _onDidProgressEnd = new Emitter<DebugProtocol.ProgressEndEvent>();
|
||||
|
||||
private readonly _onDidChangeREPLElements = new Emitter<void>();
|
||||
|
||||
@@ -184,6 +186,14 @@ export class DebugSession implements IDebugSession {
|
||||
return this._onDidLoadedSource.event;
|
||||
}
|
||||
|
||||
get onDidProgressStart(): Event<DebugProtocol.ProgressStartEvent> {
|
||||
return this._onDidProgressStart.event;
|
||||
}
|
||||
|
||||
get onDidProgressEnd(): Event<DebugProtocol.ProgressEndEvent> {
|
||||
return this._onDidProgressEnd.event;
|
||||
}
|
||||
|
||||
//---- DAP requests
|
||||
|
||||
/**
|
||||
@@ -213,7 +223,8 @@ export class DebugSession implements IDebugSession {
|
||||
supportsVariableType: true, // #8858
|
||||
supportsVariablePaging: true, // #9537
|
||||
supportsRunInTerminalRequest: true, // #10574
|
||||
locale: platform.locale
|
||||
locale: platform.locale,
|
||||
supportsProgressReporting: true // #92253
|
||||
});
|
||||
|
||||
this.initialized = true;
|
||||
@@ -913,6 +924,13 @@ export class DebugSession implements IDebugSession {
|
||||
this._onDidCustomEvent.fire(event);
|
||||
}));
|
||||
|
||||
this.rawListeners.push(this.raw.onDidProgressStart(event => {
|
||||
this._onDidProgressStart.fire(event);
|
||||
}));
|
||||
this.rawListeners.push(this.raw.onDidProgressEnd(event => {
|
||||
this._onDidProgressEnd.fire(event);
|
||||
}));
|
||||
|
||||
this.rawListeners.push(this.raw.onDidExitAdapter(event => {
|
||||
this.initialized = true;
|
||||
this.model.setBreakpointSessionData(this.getId(), this.capabilities, undefined);
|
||||
|
||||
@@ -161,6 +161,11 @@
|
||||
display: initial;
|
||||
}
|
||||
|
||||
.debug-pane .debug-call-stack .session .codicon {
|
||||
line-height: 22px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.monaco-workbench .debug-pane .debug-call-stack .monaco-action-bar .action-item > .action-label {
|
||||
width: 16px;
|
||||
height: 100%;
|
||||
@@ -234,13 +239,12 @@
|
||||
}
|
||||
|
||||
.debug-pane .debug-call-stack .load-more {
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.debug-pane .debug-call-stack .show-more {
|
||||
font-style: italic;
|
||||
opacity: 0.35;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.debug-pane .debug-call-stack .error {
|
||||
|
||||
@@ -56,20 +56,22 @@ export class RawDebugSession implements IDisposable {
|
||||
private didReceiveStoppedEvent = false;
|
||||
|
||||
// DAP events
|
||||
private readonly _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
|
||||
private readonly _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
|
||||
private readonly _onDidContinued: Emitter<DebugProtocol.ContinuedEvent>;
|
||||
private readonly _onDidTerminateDebugee: Emitter<DebugProtocol.TerminatedEvent>;
|
||||
private readonly _onDidExitDebugee: Emitter<DebugProtocol.ExitedEvent>;
|
||||
private readonly _onDidThread: Emitter<DebugProtocol.ThreadEvent>;
|
||||
private readonly _onDidOutput: Emitter<DebugProtocol.OutputEvent>;
|
||||
private readonly _onDidBreakpoint: Emitter<DebugProtocol.BreakpointEvent>;
|
||||
private readonly _onDidLoadedSource: Emitter<DebugProtocol.LoadedSourceEvent>;
|
||||
private readonly _onDidCustomEvent: Emitter<DebugProtocol.Event>;
|
||||
private readonly _onDidEvent: Emitter<DebugProtocol.Event>;
|
||||
private readonly _onDidInitialize = new Emitter<DebugProtocol.InitializedEvent>();
|
||||
private readonly _onDidStop = new Emitter<DebugProtocol.StoppedEvent>();
|
||||
private readonly _onDidContinued = new Emitter<DebugProtocol.ContinuedEvent>();
|
||||
private readonly _onDidTerminateDebugee = new Emitter<DebugProtocol.TerminatedEvent>();
|
||||
private readonly _onDidExitDebugee = new Emitter<DebugProtocol.ExitedEvent>();
|
||||
private readonly _onDidThread = new Emitter<DebugProtocol.ThreadEvent>();
|
||||
private readonly _onDidOutput = new Emitter<DebugProtocol.OutputEvent>();
|
||||
private readonly _onDidBreakpoint = new Emitter<DebugProtocol.BreakpointEvent>();
|
||||
private readonly _onDidLoadedSource = new Emitter<DebugProtocol.LoadedSourceEvent>();
|
||||
private readonly _onDidProgressStart = new Emitter<DebugProtocol.ProgressStartEvent>();
|
||||
private readonly _onDidProgressEnd = new Emitter<DebugProtocol.ProgressEndEvent>();
|
||||
private readonly _onDidCustomEvent = new Emitter<DebugProtocol.Event>();
|
||||
private readonly _onDidEvent = new Emitter<DebugProtocol.Event>();
|
||||
|
||||
// DA events
|
||||
private readonly _onDidExitAdapter: Emitter<AdapterEndEvent>;
|
||||
private readonly _onDidExitAdapter = new Emitter<AdapterEndEvent>();
|
||||
private debugAdapter: IDebugAdapter | null;
|
||||
|
||||
private toDispose: IDisposable[] = [];
|
||||
@@ -86,20 +88,6 @@ export class RawDebugSession implements IDisposable {
|
||||
this.debugAdapter = debugAdapter;
|
||||
this._capabilities = Object.create(null);
|
||||
|
||||
this._onDidInitialize = new Emitter<DebugProtocol.InitializedEvent>();
|
||||
this._onDidStop = new Emitter<DebugProtocol.StoppedEvent>();
|
||||
this._onDidContinued = new Emitter<DebugProtocol.ContinuedEvent>();
|
||||
this._onDidTerminateDebugee = new Emitter<DebugProtocol.TerminatedEvent>();
|
||||
this._onDidExitDebugee = new Emitter<DebugProtocol.ExitedEvent>();
|
||||
this._onDidThread = new Emitter<DebugProtocol.ThreadEvent>();
|
||||
this._onDidOutput = new Emitter<DebugProtocol.OutputEvent>();
|
||||
this._onDidBreakpoint = new Emitter<DebugProtocol.BreakpointEvent>();
|
||||
this._onDidLoadedSource = new Emitter<DebugProtocol.LoadedSourceEvent>();
|
||||
this._onDidCustomEvent = new Emitter<DebugProtocol.Event>();
|
||||
this._onDidEvent = new Emitter<DebugProtocol.Event>();
|
||||
|
||||
this._onDidExitAdapter = new Emitter<AdapterEndEvent>();
|
||||
|
||||
this.toDispose.push(this.debugAdapter.onError(err => {
|
||||
this.shutdown(err);
|
||||
}));
|
||||
@@ -151,6 +139,12 @@ export class RawDebugSession implements IDisposable {
|
||||
case 'exit':
|
||||
this._onDidExitDebugee.fire(<DebugProtocol.ExitedEvent>event);
|
||||
break;
|
||||
case 'progressStart':
|
||||
this._onDidProgressStart.fire(event as DebugProtocol.ProgressStartEvent);
|
||||
break;
|
||||
case 'progressEnd':
|
||||
this._onDidProgressEnd.fire(event as DebugProtocol.ProgressEndEvent);
|
||||
break;
|
||||
default:
|
||||
this._onDidCustomEvent.fire(event);
|
||||
break;
|
||||
@@ -219,6 +213,14 @@ export class RawDebugSession implements IDisposable {
|
||||
return this._onDidCustomEvent.event;
|
||||
}
|
||||
|
||||
get onDidProgressStart(): Event<DebugProtocol.ProgressStartEvent> {
|
||||
return this._onDidProgressStart.event;
|
||||
}
|
||||
|
||||
get onDidProgressEnd(): Event<DebugProtocol.ProgressEndEvent> {
|
||||
return this._onDidProgressEnd.event;
|
||||
}
|
||||
|
||||
get onDidEvent(): Event<DebugProtocol.Event> {
|
||||
return this._onDidEvent.event;
|
||||
}
|
||||
|
||||
@@ -199,6 +199,8 @@ export interface IDebugSession extends ITreeElement {
|
||||
|
||||
readonly onDidLoadedSource: Event<LoadedSourceEvent>;
|
||||
readonly onDidCustomEvent: Event<DebugProtocol.Event>;
|
||||
readonly onDidProgressStart: Event<DebugProtocol.ProgressStartEvent>;
|
||||
readonly onDidProgressEnd: Event<DebugProtocol.ProgressEndEvent>;
|
||||
|
||||
// DAP request
|
||||
|
||||
|
||||
@@ -222,6 +222,14 @@ export class MockSession implements IDebugSession {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
get onDidProgressStart(): Event<DebugProtocol.ProgressStartEvent> {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
get onDidProgressEnd(): Event<DebugProtocol.ProgressEndEvent> {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig }) { }
|
||||
|
||||
getAllThreads(): IThread[] {
|
||||
|
||||
Reference in New Issue
Block a user