MCPcopy
hub / github.com/google/go-jsonnet / SetBreakpoint

Method SetBreakpoint

debugger.go:245–267  ·  view source on GitHub ↗
(file string, line int, column int)

Source from the content-addressed store, hash-verified

243}
244
245func (d *Debugger) SetBreakpoint(file string, line int, column int) (string, error) {
246 valid, err := d.BreakpointLocations(file)
247 if err != nil {
248 return "", fmt.Errorf("getting valid breakpoint locations: %w", err)
249 }
250 target := ""
251 for _, b := range valid {
252 if b.Begin.Line == line {
253 if column < 0 {
254 target = b.String()
255 break
256 } else if b.Begin.Column == column {
257 target = b.String()
258 break
259 }
260 }
261 }
262 if target == "" {
263 return "", fmt.Errorf("breakpoint location invalid")
264 }
265 d.breakpoints[target] = true
266 return target, nil
267}
268func (d *Debugger) ClearBreakpoints(file string) {
269 abs, _ := filepath.Abs(file)
270 for k := range d.breakpoints {

Callers

nothing calls this directly

Calls 2

BreakpointLocationsMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected