Skip to content

Commit

Permalink
plugin: align breakpoint api
Browse files Browse the repository at this point in the history
The commit aligns the signature of both `addBreakpoints` and
`removeBreakpoints` to the expecations of the VS Code API.

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Mar 23, 2022
1 parent 7a44ee6 commit 4ade592
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/plugin-ext/src/plugin/node/debug/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class DebugExtImpl implements DebugExt {
return this.onDidChangeBreakpointsEmitter.event;
}

addBreakpoints(breakpoints: theia.Breakpoint[]): void {
addBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
const added: theia.Breakpoint[] = [];
for (const b of breakpoints) {
if (this._breakpoints.has(b.id)) {
Expand All @@ -147,7 +147,7 @@ export class DebugExtImpl implements DebugExt {
}
}

removeBreakpoints(breakpoints: theia.Breakpoint[]): void {
removeBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
const removed: theia.Breakpoint[] = [];
const removedIds: string[] = [];
for (const b of breakpoints) {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,10 @@ export function createAPIFactory(
stopDebugging(session?: theia.DebugSession): Thenable<void> {
return debugExt.stopDebugging(session);
},
addBreakpoints(breakpoints: theia.Breakpoint[]): void {
addBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
debugExt.addBreakpoints(breakpoints);
},
removeBreakpoints(breakpoints: theia.Breakpoint[]): void {
removeBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
debugExt.removeBreakpoints(breakpoints);
}
};
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10056,14 +10056,14 @@ export module '@theia/plugin' {
* @param breakpoints The breakpoints to add.
*/
// eslint-disable-next-line @typescript-eslint/no-shadow
export function addBreakpoints(breakpoints: Breakpoint[]): void;
export function addBreakpoints(breakpoints: readonly Breakpoint[]): void;

/**
* Remove breakpoints.
* @param breakpoints The breakpoints to remove.
*/
// eslint-disable-next-line @typescript-eslint/no-shadow
export function removeBreakpoints(breakpoints: Breakpoint[]): void;
export function removeBreakpoints(breakpoints: readonly Breakpoint[]): void;
}

/**
Expand Down

0 comments on commit 4ade592

Please sign in to comment.