mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-25 14:20:30 -04:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -20,7 +20,7 @@ import { ISuggestion } from 'vs/editor/common/modes';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import {
|
||||
ITreeElement, IExpression, IExpressionContainer, IProcess, IStackFrame, IExceptionBreakpoint, IBreakpoint, IFunctionBreakpoint, IModel, IReplElementSource,
|
||||
IConfig, ISession, IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IRawBreakpoint, IExceptionInfo, IReplElement, ProcessState
|
||||
IConfig, ISession, IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IRawBreakpoint, IExceptionInfo, IReplElement, ProcessState, IBreakpointsChangeEvent
|
||||
} from 'vs/workbench/parts/debug/common/debug';
|
||||
import { Source } from 'vs/workbench/parts/debug/common/debugSource';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -58,7 +58,7 @@ export class SimpleReplElement extends AbstractReplElement {
|
||||
|
||||
export class RawObjectReplElement extends AbstractReplElement implements IExpression {
|
||||
|
||||
private static MAX_CHILDREN = 1000; // upper bound of children per value
|
||||
private static readonly MAX_CHILDREN = 1000; // upper bound of children per value
|
||||
|
||||
constructor(public name: string, public valueObj: any, source?: IReplElementSource, public annotation?: string) {
|
||||
super(source);
|
||||
@@ -104,7 +104,7 @@ export class ExpressionContainer implements IExpressionContainer {
|
||||
|
||||
public static allValues: Map<string, string> = new Map<string, string>();
|
||||
// Use chunks to support variable paging #9537
|
||||
private static BASE_CHUNK_SIZE = 100;
|
||||
private static readonly BASE_CHUNK_SIZE = 100;
|
||||
|
||||
public valueChanged: boolean;
|
||||
private _value: string;
|
||||
@@ -159,7 +159,7 @@ export class ExpressionContainer implements IExpressionContainer {
|
||||
for (let i = 0; i < numberOfChunks; i++) {
|
||||
const start = this.startOfVariables + i * chunkSize;
|
||||
const count = Math.min(chunkSize, this.indexedVariables - i * chunkSize);
|
||||
childrenArray.push(new Variable(this.process, this, this.reference, `[${start}..${start + count - 1}]`, '', '', null, count, null, true, start));
|
||||
childrenArray.push(new Variable(this.process, this, this.reference, `[${start}..${start + count - 1}]`, '', '', null, count, { kind: 'virtual' }, null, true, start));
|
||||
}
|
||||
|
||||
return childrenArray;
|
||||
@@ -191,9 +191,9 @@ export class ExpressionContainer implements IExpressionContainer {
|
||||
filter
|
||||
}).then(response => {
|
||||
return response && response.body && response.body.variables ? distinct(response.body.variables.filter(v => !!v && v.name), v => v.name).map(
|
||||
v => new Variable(this.process, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.type)
|
||||
v => new Variable(this.process, this, v.variablesReference, v.name, v.evaluateName, v.value, v.namedVariables, v.indexedVariables, v.presentationHint, v.type)
|
||||
) : [];
|
||||
}, (e: Error) => [new Variable(this.process, this, 0, null, e.message, '', 0, 0, null, false)]) : TPromise.as([]);
|
||||
}, (e: Error) => [new Variable(this.process, this, 0, null, e.message, '', 0, 0, { kind: 'virtual' }, null, false)]) : TPromise.as([]);
|
||||
}
|
||||
|
||||
// The adapter explicitly sents the children count of an expression only if there are lots of children which should be chunked.
|
||||
@@ -278,6 +278,7 @@ export class Variable extends ExpressionContainer implements IExpression {
|
||||
value: string,
|
||||
namedVariables: number,
|
||||
indexedVariables: number,
|
||||
public presentationHint: DebugProtocol.VariablePresentationHint,
|
||||
public type: string = null,
|
||||
public available = true,
|
||||
startOfVariables = 0
|
||||
@@ -739,7 +740,7 @@ export class Model implements IModel {
|
||||
private toDispose: lifecycle.IDisposable[];
|
||||
private replElements: IReplElement[];
|
||||
private schedulers = new Map<string, RunOnceScheduler>();
|
||||
private _onDidChangeBreakpoints: Emitter<void>;
|
||||
private _onDidChangeBreakpoints: Emitter<IBreakpointsChangeEvent>;
|
||||
private _onDidChangeCallStack: Emitter<void>;
|
||||
private _onDidChangeWatchExpressions: Emitter<IExpression>;
|
||||
private _onDidChangeREPLElements: Emitter<void>;
|
||||
@@ -754,7 +755,7 @@ export class Model implements IModel {
|
||||
this.processes = [];
|
||||
this.replElements = [];
|
||||
this.toDispose = [];
|
||||
this._onDidChangeBreakpoints = new Emitter<void>();
|
||||
this._onDidChangeBreakpoints = new Emitter<IBreakpointsChangeEvent>();
|
||||
this._onDidChangeCallStack = new Emitter<void>();
|
||||
this._onDidChangeWatchExpressions = new Emitter<IExpression>();
|
||||
this._onDidChangeREPLElements = new Emitter<void>();
|
||||
@@ -780,7 +781,7 @@ export class Model implements IModel {
|
||||
this._onDidChangeCallStack.fire();
|
||||
}
|
||||
|
||||
public get onDidChangeBreakpoints(): Event<void> {
|
||||
public get onDidChangeBreakpoints(): Event<IBreakpointsChangeEvent> {
|
||||
return this._onDidChangeBreakpoints.event;
|
||||
}
|
||||
|
||||
@@ -867,9 +868,10 @@ export class Model implements IModel {
|
||||
const newBreakpoints = rawData.map(rawBp => new Breakpoint(uri, rawBp.lineNumber, rawBp.column, rawBp.enabled, rawBp.condition, rawBp.hitCondition, undefined));
|
||||
this.breakpoints = this.breakpoints.concat(newBreakpoints);
|
||||
this.breakpointsActivated = true;
|
||||
this.breakpoints = distinct(this.breakpoints, bp => `${bp.uri.toString()}:${bp.lineNumber}:${bp.column}`);
|
||||
this.sortAndDeDup();
|
||||
|
||||
if (fireEvent) {
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire({ added: newBreakpoints });
|
||||
}
|
||||
|
||||
return newBreakpoints;
|
||||
@@ -877,10 +879,11 @@ export class Model implements IModel {
|
||||
|
||||
public removeBreakpoints(toRemove: IBreakpoint[]): void {
|
||||
this.breakpoints = this.breakpoints.filter(bp => !toRemove.some(toRemove => toRemove.getId() === bp.getId()));
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire({ removed: toRemove });
|
||||
}
|
||||
|
||||
public updateBreakpoints(data: { [id: string]: DebugProtocol.Breakpoint }): void {
|
||||
const updated: IBreakpoint[] = [];
|
||||
this.breakpoints.forEach(bp => {
|
||||
const bpData = data[bp.getId()];
|
||||
if (bpData) {
|
||||
@@ -888,45 +891,82 @@ export class Model implements IModel {
|
||||
bp.endLineNumber = bpData.endLine;
|
||||
bp.column = bpData.column;
|
||||
bp.endColumn = bpData.endColumn;
|
||||
bp.verified = bpData.verified;
|
||||
bp.verified = bp.verified || bpData.verified;
|
||||
bp.idFromAdapter = bpData.id;
|
||||
bp.message = bpData.message;
|
||||
bp.adapterData = bpData.source ? bpData.source.adapterData : bp.adapterData;
|
||||
updated.push(bp);
|
||||
}
|
||||
});
|
||||
this.breakpoints = distinct(this.breakpoints, bp => `${bp.uri.toString()}:${bp.lineNumber}:${bp.column}`);
|
||||
this.sortAndDeDup();
|
||||
this._onDidChangeBreakpoints.fire({ changed: updated });
|
||||
}
|
||||
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
private sortAndDeDup(): void {
|
||||
this.breakpoints = this.breakpoints.sort((first, second) => {
|
||||
if (first.uri.toString() !== second.uri.toString()) {
|
||||
return resources.basenameOrAuthority(first.uri).localeCompare(resources.basenameOrAuthority(second.uri));
|
||||
}
|
||||
if (first.lineNumber === second.lineNumber) {
|
||||
return first.column - second.column;
|
||||
}
|
||||
|
||||
return first.lineNumber - second.lineNumber;
|
||||
});
|
||||
this.breakpoints = distinct(this.breakpoints, bp => `${bp.uri.toString()}:${bp.lineNumber}:${bp.column}`);
|
||||
}
|
||||
|
||||
public setEnablement(element: IEnablement, enable: boolean): void {
|
||||
|
||||
const changed: (IBreakpoint | IFunctionBreakpoint)[] = [];
|
||||
if (element.enabled !== enable && (element instanceof Breakpoint || element instanceof FunctionBreakpoint)) {
|
||||
changed.push(element);
|
||||
}
|
||||
|
||||
element.enabled = enable;
|
||||
if (element instanceof Breakpoint && !element.enabled) {
|
||||
const breakpoint = <Breakpoint>element;
|
||||
breakpoint.verified = false;
|
||||
}
|
||||
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire({ changed: changed });
|
||||
}
|
||||
|
||||
public enableOrDisableAllBreakpoints(enable: boolean): void {
|
||||
|
||||
const changed: (IBreakpoint | IFunctionBreakpoint)[] = [];
|
||||
|
||||
this.breakpoints.forEach(bp => {
|
||||
if (bp.enabled !== enable) {
|
||||
changed.push(bp);
|
||||
}
|
||||
bp.enabled = enable;
|
||||
if (!enable) {
|
||||
bp.verified = false;
|
||||
}
|
||||
});
|
||||
this.functionBreakpoints.forEach(fbp => fbp.enabled = enable);
|
||||
this.functionBreakpoints.forEach(fbp => {
|
||||
if (fbp.enabled !== enable) {
|
||||
changed.push(fbp);
|
||||
}
|
||||
fbp.enabled = enable;
|
||||
});
|
||||
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire({ changed: changed });
|
||||
}
|
||||
|
||||
public addFunctionBreakpoint(functionName: string): void {
|
||||
this.functionBreakpoints.push(new FunctionBreakpoint(functionName, true, null));
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
public addFunctionBreakpoint(functionName: string): FunctionBreakpoint {
|
||||
const newFunctionBreakpoint = new FunctionBreakpoint(functionName, true, null);
|
||||
this.functionBreakpoints.push(newFunctionBreakpoint);
|
||||
this._onDidChangeBreakpoints.fire({ added: [newFunctionBreakpoint] });
|
||||
|
||||
return newFunctionBreakpoint;
|
||||
}
|
||||
|
||||
public updateFunctionBreakpoints(data: { [id: string]: { name?: string, verified?: boolean; id?: number; hitCondition?: string } }): void {
|
||||
|
||||
const changed: IFunctionBreakpoint[] = [];
|
||||
|
||||
this.functionBreakpoints.forEach(fbp => {
|
||||
const fbpData = data[fbp.getId()];
|
||||
if (fbpData) {
|
||||
@@ -934,15 +974,25 @@ export class Model implements IModel {
|
||||
fbp.verified = fbpData.verified;
|
||||
fbp.idFromAdapter = fbpData.id;
|
||||
fbp.hitCondition = fbpData.hitCondition;
|
||||
|
||||
changed.push(fbp);
|
||||
}
|
||||
});
|
||||
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire({ changed: changed });
|
||||
}
|
||||
|
||||
public removeFunctionBreakpoints(id?: string): void {
|
||||
this.functionBreakpoints = id ? this.functionBreakpoints.filter(fbp => fbp.getId() !== id) : [];
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
|
||||
let removed: IFunctionBreakpoint[];
|
||||
if (id) {
|
||||
removed = this.functionBreakpoints.filter(fbp => fbp.getId() === id);
|
||||
this.functionBreakpoints = this.functionBreakpoints.filter(fbp => fbp.getId() !== id);
|
||||
} else {
|
||||
removed = this.functionBreakpoints;
|
||||
this.functionBreakpoints = [];
|
||||
}
|
||||
this._onDidChangeBreakpoints.fire({ removed: removed });
|
||||
}
|
||||
|
||||
public getReplElements(): IReplElement[] {
|
||||
|
||||
Reference in New Issue
Block a user