@@ -151,6 +151,7 @@ Provide only the code to insert at the cursor position.`
151151 this . setupDebuggerBreakpoints ( ) ;
152152 this . setupDebuggerBreakpointToggle ( ) ;
153153 this . setupDebuggerBreakpointHover ( ) ;
154+ this . setupClearBreakpointsButton ( ) ;
154155
155156 return this . editor ;
156157 }
@@ -519,9 +520,38 @@ Provide only the code to insert at the cursor position.`
519520 this . breakpointTooltip = tooltip ;
520521 return tooltip ;
521522 }
522-
523- defineVSDarkTheme ( ) {
524- monaco . editor . defineTheme ( 'vs-dark-custom' , {
523+
524+ setupClearBreakpointsButton ( ) {
525+ const clearBreakpointsButton = document . getElementById ( 'clearBreakpointsButton' ) ;
526+ if ( ! clearBreakpointsButton ) {
527+ return ;
528+ }
529+
530+ clearBreakpointsButton . addEventListener ( 'click' , ( ) => {
531+ this . clearAllBreakpoints ( ) ;
532+ } ) ;
533+ }
534+
535+ clearAllBreakpoints ( ) {
536+ this . setBreakpointLines ( [ ] ) ;
537+
538+ try {
539+ const keysToRemove = [ ] ;
540+ for ( let index = 0 ; index < localStorage . length ; index += 1 ) {
541+ const key = localStorage . key ( index ) ;
542+ if ( key && key . startsWith ( this . breakpointStoragePrefix ) ) {
543+ keysToRemove . push ( key ) ;
544+ }
545+ }
546+
547+ keysToRemove . forEach ( key => localStorage . removeItem ( key ) ) ;
548+ } catch ( error ) {
549+ console . warn ( '无法清空全部断点信息:' , error ) ;
550+ }
551+ }
552+
553+ defineVSDarkTheme ( ) {
554+ monaco . editor . defineTheme ( 'vs-dark-custom' , {
525555 base : 'vs-dark' ,
526556 inherit : true ,
527557 rules : [
0 commit comments