mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Prefer using Array<T> for complex array types
Use `Array<T | U>` when dealing with union types instead of `(T | U)[]`
This commit is contained in:
@@ -615,7 +615,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
|
||||
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
|
||||
$appendDebugConsole(value: string): void;
|
||||
$startBreakpointEvents(): void;
|
||||
$registerBreakpoints(breakpoints: (ISourceMultiBreakpointDto | IFunctionBreakpointDto)[]): Promise<void>;
|
||||
$registerBreakpoints(breakpoints: Array<ISourceMultiBreakpointDto | IFunctionBreakpointDto>): Promise<void>;
|
||||
$unregisterBreakpoints(breakpointIds: string[], functionBreakpointIds: string[]): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ export interface ResourceTextEditDto {
|
||||
}
|
||||
|
||||
export interface WorkspaceEditDto {
|
||||
edits: (ResourceFileEditDto | ResourceTextEditDto)[];
|
||||
edits: Array<ResourceFileEditDto | ResourceTextEditDto>;
|
||||
|
||||
// todo@joh reject should go into rename
|
||||
rejectReason?: string;
|
||||
@@ -962,9 +962,9 @@ export interface ISourceBreakpointDto extends IBreakpointDto {
|
||||
}
|
||||
|
||||
export interface IBreakpointsDeltaDto {
|
||||
added?: (ISourceBreakpointDto | IFunctionBreakpointDto)[];
|
||||
added?: Array<ISourceBreakpointDto | IFunctionBreakpointDto>;
|
||||
removed?: string[];
|
||||
changed?: (ISourceBreakpointDto | IFunctionBreakpointDto)[];
|
||||
changed?: Array<ISourceBreakpointDto | IFunctionBreakpointDto>;
|
||||
}
|
||||
|
||||
export interface ISourceMultiBreakpointDto {
|
||||
|
||||
@@ -178,7 +178,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
|
||||
this.fireBreakpointChanges(breakpoints, [], []);
|
||||
|
||||
// convert added breakpoints to DTOs
|
||||
const dtos: (ISourceMultiBreakpointDto | IFunctionBreakpointDto)[] = [];
|
||||
const dtos: Array<ISourceMultiBreakpointDto | IFunctionBreakpointDto> = [];
|
||||
const map = new Map<string, ISourceMultiBreakpointDto>();
|
||||
for (const bp of breakpoints) {
|
||||
if (bp instanceof SourceBreakpoint) {
|
||||
|
||||
@@ -169,7 +169,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
|
||||
}
|
||||
// flatten all WorkspaceEdits collected via waitUntil-call
|
||||
// and apply them in one go.
|
||||
let allEdits = new Array<(ResourceFileEditDto | ResourceTextEditDto)[]>();
|
||||
let allEdits = new Array<Array<ResourceFileEditDto | ResourceTextEditDto>>();
|
||||
for (let edit of edits) {
|
||||
if (edit) { // sparse array
|
||||
let { edits } = typeConverter.WorkspaceEdit.from(edit, this._extHostDocumentsAndEditors);
|
||||
|
||||
Reference in New Issue
Block a user