mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 17:23:35 -05:00
Merge from vscode 70dc55955d586ebd427658b43cdb344f2047f9c2 (#6789)
This commit is contained in:
@@ -103,6 +103,7 @@ export interface IReplElementSource {
|
||||
export interface IExpressionContainer extends ITreeElement {
|
||||
readonly hasChildren: boolean;
|
||||
getChildren(): Promise<IExpression[]>;
|
||||
readonly reference?: number;
|
||||
}
|
||||
|
||||
export interface IExpression extends IReplElement, IExpressionContainer {
|
||||
@@ -201,6 +202,8 @@ export interface IDebugSession extends ITreeElement {
|
||||
|
||||
sendBreakpoints(modelUri: uri, bpts: IBreakpoint[], sourceModified: boolean): Promise<void>;
|
||||
sendFunctionBreakpoints(fbps: IFunctionBreakpoint[]): Promise<void>;
|
||||
dataBreakpointInfo(name: string, variablesReference?: number): Promise<{ dataId: string | null, description: string, canPersist?: boolean }>;
|
||||
sendDataBreakpoints(dbps: IDataBreakpoint[]): Promise<void>;
|
||||
sendExceptionBreakpoints(exbpts: IExceptionBreakpoint[]): Promise<void>;
|
||||
|
||||
stackTrace(threadId: number, startFrame: number, levels: number): Promise<DebugProtocol.StackTraceResponse>;
|
||||
@@ -357,6 +360,12 @@ export interface IExceptionBreakpoint extends IEnablement {
|
||||
readonly label: string;
|
||||
}
|
||||
|
||||
export interface IDataBreakpoint extends IBaseBreakpoint {
|
||||
readonly label: string;
|
||||
readonly dataId: string;
|
||||
readonly canPersist: boolean;
|
||||
}
|
||||
|
||||
export interface IExceptionInfo {
|
||||
readonly id?: string;
|
||||
readonly description?: string;
|
||||
@@ -404,6 +413,7 @@ export interface IDebugModel extends ITreeElement {
|
||||
getBreakpoints(filter?: { uri?: uri, lineNumber?: number, column?: number, enabledOnly?: boolean }): ReadonlyArray<IBreakpoint>;
|
||||
areBreakpointsActivated(): boolean;
|
||||
getFunctionBreakpoints(): ReadonlyArray<IFunctionBreakpoint>;
|
||||
getDataBreakpoints(): ReadonlyArray<IDataBreakpoint>;
|
||||
getExceptionBreakpoints(): ReadonlyArray<IExceptionBreakpoint>;
|
||||
getWatchExpressions(): ReadonlyArray<IExpression & IEvaluate>;
|
||||
|
||||
@@ -416,9 +426,9 @@ export interface IDebugModel extends ITreeElement {
|
||||
* An event describing a change to the set of [breakpoints](#debug.Breakpoint).
|
||||
*/
|
||||
export interface IBreakpointsChangeEvent {
|
||||
added?: Array<IBreakpoint | IFunctionBreakpoint>;
|
||||
removed?: Array<IBreakpoint | IFunctionBreakpoint>;
|
||||
changed?: Array<IBreakpoint | IFunctionBreakpoint>;
|
||||
added?: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint>;
|
||||
removed?: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint>;
|
||||
changed?: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint>;
|
||||
sessionOnly?: boolean;
|
||||
}
|
||||
|
||||
@@ -754,6 +764,17 @@ export interface IDebugService {
|
||||
*/
|
||||
removeFunctionBreakpoints(id?: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Adds a new data breakpoint.
|
||||
*/
|
||||
addDataBreakpoint(label: string, dataId: string, canPersist: boolean): Promise<void>;
|
||||
|
||||
/**
|
||||
* Removes all data breakpoints. If id is passed only removes the data breakpoint with the passed id.
|
||||
* Notifies debug adapter of breakpoint changes.
|
||||
*/
|
||||
removeDataBreakpoints(id?: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Sends all breakpoints to the passed session.
|
||||
* If session is not passed, sends all breakpoints to each session.
|
||||
|
||||
@@ -16,7 +16,7 @@ import { distinct, lastIndex } from 'vs/base/common/arrays';
|
||||
import { Range, IRange } from 'vs/editor/common/core/range';
|
||||
import {
|
||||
ITreeElement, IExpression, IExpressionContainer, IDebugSession, IStackFrame, IExceptionBreakpoint, IBreakpoint, IFunctionBreakpoint, IDebugModel, IReplElementSource,
|
||||
IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IBreakpointData, IExceptionInfo, IReplElement, IBreakpointsChangeEvent, IBreakpointUpdateData, IBaseBreakpoint, State
|
||||
IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IBreakpointData, IExceptionInfo, IReplElement, IBreakpointsChangeEvent, IBreakpointUpdateData, IBaseBreakpoint, State, IDataBreakpoint
|
||||
} from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { Source, UNKNOWN_SOURCE_LABEL } from 'vs/workbench/contrib/debug/common/debugSource';
|
||||
import { commonSuffixLength } from 'vs/base/common/strings';
|
||||
@@ -735,6 +735,34 @@ export class FunctionBreakpoint extends BaseBreakpoint implements IFunctionBreak
|
||||
}
|
||||
}
|
||||
|
||||
export class DataBreakpoint extends BaseBreakpoint implements IDataBreakpoint {
|
||||
|
||||
constructor(
|
||||
public label: string,
|
||||
public dataId: string,
|
||||
public canPersist: boolean,
|
||||
enabled: boolean,
|
||||
hitCondition: string | undefined,
|
||||
condition: string | undefined,
|
||||
logMessage: string | undefined,
|
||||
id = generateUuid()
|
||||
) {
|
||||
super(enabled, hitCondition, condition, logMessage, id);
|
||||
}
|
||||
|
||||
toJSON(): any {
|
||||
const result = super.toJSON();
|
||||
result.label = this.label;
|
||||
result.dataid = this.dataId;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return this.label;
|
||||
}
|
||||
}
|
||||
|
||||
export class ExceptionBreakpoint extends Enablement implements IExceptionBreakpoint {
|
||||
|
||||
constructor(public filter: string, public label: string, enabled: boolean) {
|
||||
@@ -778,6 +806,7 @@ export class DebugModel implements IDebugModel {
|
||||
private breakpointsActivated: boolean,
|
||||
private functionBreakpoints: FunctionBreakpoint[],
|
||||
private exceptionBreakpoints: ExceptionBreakpoint[],
|
||||
private dataBreakopints: DataBreakpoint[],
|
||||
private watchExpressions: Expression[],
|
||||
private textFileService: ITextFileService
|
||||
) {
|
||||
@@ -918,6 +947,10 @@ export class DebugModel implements IDebugModel {
|
||||
return this.functionBreakpoints;
|
||||
}
|
||||
|
||||
getDataBreakpoints(): IDataBreakpoint[] {
|
||||
return this.dataBreakopints;
|
||||
}
|
||||
|
||||
getExceptionBreakpoints(): IExceptionBreakpoint[] {
|
||||
return this.exceptionBreakpoints;
|
||||
}
|
||||
@@ -991,6 +1024,12 @@ export class DebugModel implements IDebugModel {
|
||||
fbp.setSessionData(sessionId, fbpData);
|
||||
}
|
||||
});
|
||||
this.dataBreakopints.forEach(dbp => {
|
||||
const dbpData = data.get(dbp.getId());
|
||||
if (dbpData) {
|
||||
dbp.setSessionData(sessionId, dbpData);
|
||||
}
|
||||
});
|
||||
|
||||
this._onDidChangeBreakpoints.fire({
|
||||
sessionOnly: true
|
||||
@@ -1001,6 +1040,7 @@ export class DebugModel implements IDebugModel {
|
||||
this.breakpointsSessionId = sessionId;
|
||||
this.breakpoints.forEach(bp => bp.setSessionId(sessionId));
|
||||
this.functionBreakpoints.forEach(fbp => fbp.setSessionId(sessionId));
|
||||
this.dataBreakopints.forEach(dbp => dbp.setSessionId(sessionId));
|
||||
|
||||
this._onDidChangeBreakpoints.fire({
|
||||
sessionOnly: true
|
||||
@@ -1038,7 +1078,7 @@ export class DebugModel implements IDebugModel {
|
||||
}
|
||||
|
||||
enableOrDisableAllBreakpoints(enable: boolean): void {
|
||||
const changed: Array<IBreakpoint | IFunctionBreakpoint> = [];
|
||||
const changed: Array<IBreakpoint | IFunctionBreakpoint | IDataBreakpoint> = [];
|
||||
|
||||
this.breakpoints.forEach(bp => {
|
||||
if (bp.enabled !== enable) {
|
||||
@@ -1052,6 +1092,12 @@ export class DebugModel implements IDebugModel {
|
||||
}
|
||||
fbp.enabled = enable;
|
||||
});
|
||||
this.dataBreakopints.forEach(dbp => {
|
||||
if (dbp.enabled !== enable) {
|
||||
changed.push(dbp);
|
||||
}
|
||||
dbp.enabled = enable;
|
||||
});
|
||||
|
||||
this._onDidChangeBreakpoints.fire({ changed: changed });
|
||||
}
|
||||
@@ -1073,7 +1119,6 @@ export class DebugModel implements IDebugModel {
|
||||
}
|
||||
|
||||
removeFunctionBreakpoints(id?: string): void {
|
||||
|
||||
let removed: FunctionBreakpoint[];
|
||||
if (id) {
|
||||
removed = this.functionBreakpoints.filter(fbp => fbp.getId() === id);
|
||||
@@ -1082,7 +1127,25 @@ export class DebugModel implements IDebugModel {
|
||||
removed = this.functionBreakpoints;
|
||||
this.functionBreakpoints = [];
|
||||
}
|
||||
this._onDidChangeBreakpoints.fire({ removed: removed });
|
||||
this._onDidChangeBreakpoints.fire({ removed });
|
||||
}
|
||||
|
||||
addDataBreakpoint(label: string, dataId: string, canPersist: boolean): void {
|
||||
const newDataBreakpoint = new DataBreakpoint(label, dataId, canPersist, true, undefined, undefined, undefined);
|
||||
this.dataBreakopints.push(newDataBreakpoint);
|
||||
this._onDidChangeBreakpoints.fire({ added: [newDataBreakpoint] });
|
||||
}
|
||||
|
||||
removeDataBreakpoints(id?: string): void {
|
||||
let removed: DataBreakpoint[];
|
||||
if (id) {
|
||||
removed = this.dataBreakopints.filter(fbp => fbp.getId() === id);
|
||||
this.dataBreakopints = this.dataBreakopints.filter(fbp => fbp.getId() !== id);
|
||||
} else {
|
||||
removed = this.dataBreakopints;
|
||||
this.dataBreakopints = [];
|
||||
}
|
||||
this._onDidChangeBreakpoints.fire({ removed });
|
||||
}
|
||||
|
||||
getWatchExpressions(): Expression[] {
|
||||
|
||||
Reference in New Issue
Block a user