MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / setBreakpoints

Method setBreakpoints

src/debug/threads.ts:154–177  ·  view source on GitHub ↗
(uri: string, breakpoints: DebugProtocol.SourceBreakpoint[])

Source from the content-addressed store, hash-verified

152 }
153
154 public setBreakpoints(uri: string, breakpoints: DebugProtocol.SourceBreakpoint[]): Promise<any[]> {
155 // Remember these bps for when new threads start.
156 if (breakpoints.length === 0)
157 delete this.bps[uri];
158 else
159 this.bps[uri] = breakpoints;
160
161 let promise;
162
163 for (const thread of this.threads) {
164 if (thread.runnable) {
165 const result = thread.setBreakpoints(this.logger, uri, breakpoints);
166 if (!promise)
167 promise = result;
168 }
169 }
170
171 if (promise)
172 return promise;
173
174 const completer = new PromiseCompleter<boolean[]>();
175 completer.resolve(breakpoints.map(() => true));
176 return completer.promise;
177 }
178
179 public nextDataId = 1;
180 public storedData: { [id: number]: StoredData } = {};

Callers

nothing calls this directly

Calls 1

setBreakpointsMethod · 0.45

Tested by

no test coverage detected