22
33/* @flow */
44
5- import Breakpoint from './breakpoint'
6- import DebuggerRegistry from './debugger-registry'
7- import ProjectConfig from './project-config'
8- import ViewRegistry from './view-registry'
5+ import Breakpoint from './breakpoint'
6+ import DebuggerRegistry from './debugger-registry'
7+ import ProjectConfig from './project-config'
8+ import ViewRegistry from './view-registry'
99
1010import type { Debugger , DebuggerView } from './types'
1111
1212export default class DebuggerController {
1313 debuggerRegistry : DebuggerRegistry ;
14- viewRegistry : ViewRegistry ;
14+ viewRegistry : ViewRegistry ;
1515
1616 constructor ( ) {
1717 this . debuggerRegistry = new DebuggerRegistry ( )
18- this . viewRegistry = new ViewRegistry ( this )
18+ this . viewRegistry = new ViewRegistry ( this )
1919
2020 atom . commands . add ( 'atom-text-editor' , {
2121 'debugger:start' : ( ) => { this . start ( ) } ,
@@ -24,7 +24,7 @@ export default class DebuggerController {
2424 'debugger:pause' : ( ) => { this . pause ( ) } ,
2525 'debugger:step-into' : ( ) => { this . stepInto ( ) } ,
2626 'debugger:step-over' : ( ) => { this . stepOver ( ) } ,
27- 'debugger:toggle-breakpoint-at-current-line' : ( ) => { this . toggleBreakpoint ( ) }
27+ 'debugger:toggle-breakpoint-at-current-line' : ( ) => { this . toggleBreakpoint ( ) } ,
2828 } )
2929 }
3030
@@ -33,7 +33,7 @@ export default class DebuggerController {
3333 }
3434
3535 addView ( view : DebuggerView ) : void {
36- this . viewRegistry . add ( view ) ;
36+ this . viewRegistry . add ( view )
3737 }
3838
3939 deleteView ( view : DebuggerView ) : void {
@@ -42,46 +42,40 @@ export default class DebuggerController {
4242
4343 /* Commands */
4444 start ( ) : void {
45- let proxy = this . debuggerRegistry . getDebuggerProxy ( )
46- let config
45+ const proxy = this . debuggerRegistry . getDebuggerProxy ( )
4746
4847 if ( proxy . getActiveDebugger ( ) != null ) {
49-
5048 atom . notifications . addError (
5149 'There is a session in progress. Please, exit first.' )
5250
5351 return
5452 }
5553
56- config = new ProjectConfig ( )
54+ const config = new ProjectConfig ( )
5755 config . tryLoad ( )
5856
5957 if ( ! config . data ) {
60-
6158 atom . notifications . addError ( 'The project has no config.' )
6259
6360 return
6461 }
6562
6663 if ( ! config . data . target ) {
67-
6864 atom . notifications . addError ( 'The project has no target set.' )
6965
7066 return
7167 }
7268
7369 if ( ! config . data . debugger ) {
74-
7570 atom . notifications . addError ( 'The project has no debugger set.' )
7671
7772 return
7873 }
7974
8075 const target = config . data . target
81- const debug = this . debuggerRegistry . get ( config . data . debugger )
76+ const debug = this . debuggerRegistry . get ( config . data . debugger )
8277
8378 if ( ! debug ) {
84-
8579 atom . notifications . addFatalError ( 'The debugger is unknown.' )
8680
8781 return
@@ -117,14 +111,14 @@ export default class DebuggerController {
117111 return
118112 }
119113
120- let breakpoint = new Breakpoint ( {
121- filePath : activeEditor . getPath ( ) ,
122- bufferRow : activeEditor . getCursorBufferPosition ( ) . row
114+ const breakpoint = new Breakpoint ( {
115+ filePath : activeEditor . getPath ( ) ,
116+ bufferRow : activeEditor . getCursorBufferPosition ( ) . row ,
123117 } )
124118
125119 const debug = this . debuggerRegistry . getDebuggerProxy ( )
126120
127- if ( debug . removeBreakpoint ( breakpoint ) == false ) {
121+ if ( debug . removeBreakpoint ( breakpoint ) === false ) {
128122 debug . insertBreakpoint ( breakpoint )
129123 }
130124 }
0 commit comments