Skip to content

Commit 585c2b8

Browse files
authored
Merge pull request #12 from gsmcmullin/gsmcmullin/maintenance
Maintenance
2 parents a98f2d5 + e9026be commit 585c2b8

22 files changed

+207
-205
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
decls
2+
spec

.eslintrc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "steelbrain",
3+
"rules": {
4+
"no-param-reassign": "off",
5+
"no-duplicate-imports": "off",
6+
"import/prefer-default-export": "off"
7+
}
8+
}

.flowconfig

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
[ignore]
2-
node_modules/**/.*
32

43
[include]
54

65
[libs]
7-
interface
8-
node_modules/flow-atom-api/sig/v1.7.4
9-
node_modules/flow-atom-api/node_modules/flow-json/sig
10-
node_modules/flow-atom-api/node_modules/flow-json-schema/sig
11-
node_modules/flow-atom-api/node_modules/flow-atom-event-kit/sig/v1.5.0
12-
node_modules/flow-atom-api/node_modules/flow-atom-first-mate/sig/v5.1.1
13-
node_modules/flow-atom-api/node_modules/flow-atom-keymap/sig/v6.3.2
14-
node_modules/flow-atom-api/node_modules/flow-atom-node/sig
15-
node_modules/flow-atom-api/node_modules/flow-atom-oniguruma/sig/v6.1.0
16-
node_modules/flow-atom-api/node_modules/flow-atom-pathwatcher/sig/v6.2.4
17-
node_modules/flow-atom-api/node_modules/flow-atom-text-buffer/sig/v8.5.0
18-
node_modules/flow-atom-api/node_modules/flow-electron-api/sig/v1.1.1
19-
node_modules/flow-atom-api/node_modules/iflow-jquery/index.js.flow
6+
decls
7+
node_modules/@flow-atom/atom/sig/v1.8.0/
8+
node_modules/@flow-atom/keymap/sig/v6.3.2/
9+
node_modules/@flow-atom/electron/sig/v0.37.8/
10+
node_modules/@flow-atom/oniguruma/sig/v6.1.0/
11+
node_modules/@flow-atom/event-kit/sig/v2.0.0/
12+
node_modules/@flow-atom/pathwatcher/sig/v6.7.0/
13+
node_modules/@flow-atom/first-mate/sig/v5.1.1/
14+
node_modules/@flow-atom/text-buffer/sig/v9.2.2/
15+
node_modules/iflow-jquery/index.js.flow
2016

2117
[options]
18+
module.system=node

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
.DS_Store

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 Philipp von Radziewsky
3+
Copyright (c) 2016 AtomDebugger Team (Philipp von Radziewsky & Steel Brain)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

circle.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
dependencies:
2+
override:
3+
- curl -L https://atom.io/download/deb -o atom-amd64.deb
4+
- sudo dpkg --install atom-amd64.deb || true
5+
- sudo apt-get update
6+
- sudo apt-get -f install
7+
- node --version
8+
- npm --version
9+
- atom --version
10+
- npm prune
11+
- npm install
12+
- apm rebuild
13+
- npm build
14+
15+
test:
16+
override:
17+
- npm test
18+
19+
machine:
20+
node:
21+
version: 6
File renamed without changes.

decls/jasmine.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* @flow */
2+
3+
declare function it(name: string, callback: (() => void)): void;
4+
declare function fit(name: string, callback: (() => void)): void;
5+
declare function expect(value: any): Object;
6+
declare function describe(name: string, callback: (() => void)): void;
7+
declare function fdescribe(name: string, callback: (() => void)): void;
8+
declare function beforeEach(callback: (() => void)): void;
9+
declare function afterEach(callback: (() => void)): void;

lib/breakpoint-event.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@
44

55
import Breakpoint from './breakpoint'
66

7-
export type BreakpointEventType = 'inserted' | 'removed' | 'enabled' |
8-
'disabled' | 'moved' |
9-
'condition-added' | 'condition-removed'
7+
export type BreakpointEventType = 'inserted' | 'removed' | 'enabled' |
8+
'disabled' | 'moved' |
9+
'condition-added' | 'condition-removed'
1010

1111
export default class BreakpointEvent {
12-
type: BreakpointEventType;
12+
type: BreakpointEventType;
1313
breakpoint: Breakpoint;
14-
bufferRow: ?number;
14+
bufferRow: ?number;
1515

16-
constructor(
17-
type: BreakpointEventType, breakpoint: Breakpoint, bufferRow?: number) {
18-
19-
this.type = type
16+
constructor(type: BreakpointEventType,
17+
breakpoint: Breakpoint,
18+
bufferRow?: number) {
19+
this.type = type
2020
this.breakpoint = breakpoint
2121

2222
if (type === 'moved') {
23-
2423
if (bufferRow == null || typeof bufferRow !== 'number') {
2524
throw new Error('bufferRow must be a number')
2625
}

lib/breakpoint.js

+10-14
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
/* @flow */
44

55
export type FunctionBreakpoint = { function: string }
6-
export type LineBreakpoint = { filePath: string, bufferRow: number }
6+
export type LineBreakpoint = { filePath: string, bufferRow: number }
77
export type BreakpointLocation = LineBreakpoint | FunctionBreakpoint
88

99
export default class Breakpoint {
10-
location: BreakpointLocation;
11-
enabled: boolean;
12-
condition: ?string;
10+
location: BreakpointLocation;
11+
enabled: boolean;
12+
condition: ?string;
1313
activeBufferRow: ?number;
1414

1515
constructor(location: BreakpointLocation, condition?: string) {
16-
1716
if (!location.function && (!location.filePath || !location.bufferRow)) {
1817
throw new TypeError('location must be BreakpointLocation')
1918
}
2019

21-
this.location = location
22-
this.condition = (condition) ? condition : null
23-
this.enabled = true
20+
this.location = location
21+
this.condition = condition || null
22+
this.enabled = true
2423
this.activeBufferRow = null
2524
}
2625

@@ -33,14 +32,12 @@ export default class Breakpoint {
3332
}
3433

3534
equals(other: Breakpoint): bool {
36-
3735
if (this.location.function && other.location.function) {
38-
3936
return (this.location.function === other.location.function)
4037
} else if (this.location.filePath && other.location.filePath) {
41-
const same_file = (this.location.filePath === other.location.filePath)
38+
const sameFile = (this.location.filePath === other.location.filePath)
4239

43-
if (same_file && this.location.bufferRow && other.location.bufferRow) {
40+
if (sameFile && this.location.bufferRow && other.location.bufferRow) {
4441
return (this.location.bufferRow === other.location.bufferRow)
4542
}
4643
}
@@ -49,9 +46,8 @@ export default class Breakpoint {
4946
}
5047

5148
toHumanized(): string {
52-
5349
if (this.location.filePath && this.location.bufferRow) {
54-
return this.location.filePath + ':' + (this.location.bufferRow+1)
50+
return `${this.location.filePath}:${this.location.bufferRow + 1}`
5551
}
5652

5753
return '?'

lib/debugger-controller.js

+15-21
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
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

1010
import type { Debugger, DebuggerView } from './types'
1111

1212
export 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

Comments
 (0)