-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintenance #3
Open
steelbrain
wants to merge
21
commits into
master
Choose a base branch
from
steelbrain/maintenance
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Maintenance #3
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2c09301
:new: Add CI config
469a11d
:new: Add scripts and devDeps
2d9d299
:new: Add ESLint config
df8b303
:fire: Cleanup flow config
931f920
:minibus: interface -> decls
e0af173
:no_entry: Git ignore .DS_Store files
84bcfff
:memo: Change LICENSE to AtomDebugger Team
07096d9
:minibus: main -> index
9998b37
:arrow_up: Bump dep versions
fe5f264
:new: Run atom-package-deps properly
e251402
:art: Update author in manifest
e892696
:minibus: debugger-event-defs -> debugger-event-definitions
e4d9c09
:minibus: lib -> lib-old
fbf1189
:new: Add new package structure
21cdfa7
:new: Add more structure stuff
9cdd4cd
:fire: Cleanup manifest and dot files
08f8f17
:no_entry: Disallow publishing to npm registry
f6a296a
:fire: Cleanup manifest and commands
1cbbe88
:new: Make basic commands work
15ba149
:new: Connect wires with UI Registry
ff1524b
:arrow_up: Address reviewer's comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
decls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "steelbrain", | ||
"rules": { | ||
"no-param-reassign": "off", | ||
"no-duplicate-imports": "off", | ||
"import/prefer-default-export": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
[ignore] | ||
node_modules/**/.* | ||
|
||
[include] | ||
|
||
[libs] | ||
interface | ||
node_modules/flow-atom-api/sig/v1.7.4 | ||
node_modules/flow-atom-api/node_modules/flow-json/sig | ||
node_modules/flow-atom-api/node_modules/flow-json-schema/sig | ||
node_modules/flow-atom-api/node_modules/flow-atom-event-kit/sig/v1.5.0 | ||
node_modules/flow-atom-api/node_modules/flow-atom-first-mate/sig/v5.1.1 | ||
node_modules/flow-atom-api/node_modules/flow-atom-keymap/sig/v6.3.2 | ||
node_modules/flow-atom-api/node_modules/flow-atom-node/sig | ||
node_modules/flow-atom-api/node_modules/flow-atom-oniguruma/sig/v6.1.0 | ||
node_modules/flow-atom-api/node_modules/flow-atom-pathwatcher/sig/v6.2.4 | ||
node_modules/flow-atom-api/node_modules/flow-atom-text-buffer/sig/v8.5.0 | ||
node_modules/flow-atom-api/node_modules/flow-electron-api/sig/v1.1.1 | ||
node_modules/flow-atom-api/node_modules/iflow-jquery/index.js.flow | ||
decls | ||
|
||
[options] | ||
module.system=node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
dependencies: | ||
override: | ||
- curl -L https://atom.io/download/deb -o atom-amd64.deb | ||
- sudo dpkg --install atom-amd64.deb || true | ||
- sudo apt-get update | ||
- sudo apt-get -f install | ||
- node --version | ||
- npm --version | ||
- atom --version | ||
- npm prune | ||
- npm install | ||
- apm rebuild | ||
|
||
test: | ||
override: | ||
- npm test | ||
|
||
machine: | ||
node: | ||
version: 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* @flow */ | ||
|
||
declare var atom: Object; | ||
declare module 'atom' { | ||
declare var Point: any; | ||
declare var Range: any; | ||
declare var Panel: any; | ||
declare var TextEditor: any; | ||
declare var TextBuffer: any; | ||
declare var BufferMarker: any; | ||
declare var TextEditorGutter: any; | ||
declare var TextEditorMarker: any; | ||
declare var CompositeDisposable: any; | ||
declare var Disposable: any; | ||
declare var Emitter: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* @flow */ | ||
|
||
declare function it(name: string, callback: (() => void)): void; | ||
declare function fit(name: string, callback: (() => void)): void; | ||
declare function expect(value: any): Object; | ||
declare function describe(name: string, callback: (() => void)): void; | ||
declare function fdescribe(name: string, callback: (() => void)): void; | ||
declare function beforeEach(callback: (() => void)): void; | ||
declare function afterEach(callback: (() => void)): void; |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use babel' | ||
|
||
/* @flow */ | ||
|
||
import Breakpoint from './breakpoint' | ||
import BreakpointEvent from './breakpoint-event' | ||
import DebuggerController from './debugger-controller' | ||
import SessionEvent from './session-event' | ||
import TargetEvent from './target-event' | ||
import type { Debugger, DebuggerView } from './types' | ||
import { Disposable } from 'atom' | ||
|
||
module.exports = { | ||
instance: DebuggerController, | ||
|
||
activate(): void { | ||
this.instance = new DebuggerController() | ||
require('atom-package-deps').install('debugger') // eslint-disable-line | ||
}, | ||
|
||
provideEventDefs(): Object { | ||
return { | ||
'BreakpointEvent': BreakpointEvent, | ||
'SessionEvent': SessionEvent, | ||
'TargetEvent': TargetEvent | ||
} | ||
}, | ||
|
||
consumeView(view: DebuggerView): Disposable { | ||
this.instance.addView(view) | ||
|
||
return new Disposable(() => { | ||
this.instance.deleteView(view) | ||
}) | ||
}, | ||
|
||
consumeDebugger(debug: Debugger): Disposable { | ||
this.instance.addDebugger(debug) | ||
|
||
return new Disposable(() => { | ||
this.instance.deleteDebugger(debug) | ||
}) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use babel' | ||
|
||
/* @flow */ | ||
|
||
import DebuggerController from './debugger-controller' | ||
import Breakpoint from './breakpoint' | ||
|
||
import type { StackFrame } from './stack-frame' | ||
import type { Variable } from './variable' | ||
|
||
export type DebuggerTarget = { | ||
filePath: string, | ||
arguments: ?string | ||
} | ||
|
||
export type DebuggerView = { | ||
|
||
activate(controller: DebuggerController): void, | ||
|
||
dispose(): void | ||
} | ||
|
||
export type Debugger = { | ||
|
||
name(): string, | ||
|
||
onSessionEvent(callback: Function): void, | ||
|
||
onBreakpointEvent(callback: Function): void, | ||
|
||
onTargetEvent(callback: Function): void, | ||
|
||
start(target: DebuggerTarget): void, | ||
|
||
stop(): void, | ||
|
||
resume(): void, | ||
|
||
pause(): void, | ||
|
||
stepInto(): void, | ||
|
||
stepOver(): void, | ||
|
||
insertBreakpoint(breakpoint: Breakpoint): void, | ||
|
||
getCallStack(): Promise<Array<StackFrame>>, | ||
|
||
getSelectedFrame(): Promise<StackFrame>, | ||
|
||
setSelectedFrame(level: number): void, | ||
|
||
getVariableList(): Promise<Array<Variable>> | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* @flow */ | ||
|
||
import { CompositeDisposable, Emitter } from 'atom' | ||
import type DebuggerDelegate from './delegate' | ||
|
||
export default class Commands { | ||
active: ?DebuggerDelegate; | ||
emitter: Emitter; | ||
subscriptions: CompositeDisposable; | ||
|
||
constructor() { | ||
this.active = null | ||
this.emitter = new Emitter() | ||
this.subscriptions = new CompositeDisposable() | ||
|
||
this.subscriptions.add(this.emitter) | ||
} | ||
activate() { | ||
this.subscriptions.add(atom.commands.add('atom-text-editor:not([mini])', { | ||
'debugger:start': () => this.start(), | ||
'debugger:stop': () => this.stop(), | ||
})) | ||
} | ||
start() { | ||
if (this.active) { | ||
return | ||
} | ||
const delegate = this.requestDelegate() | ||
if (!delegate) { | ||
return | ||
} | ||
this.active = delegate | ||
this.active.start() | ||
} | ||
stop() { | ||
if (this.active) { | ||
this.active.stop() | ||
this.emitter.emit('did-stop', this.active) | ||
this.active = null | ||
} | ||
} | ||
requestDelegate(): ?DebuggerDelegate { | ||
const event = { delegate: null } | ||
this.emitter.emit('request-delegate', event) | ||
return event.delegate | ||
} | ||
onShouldProvideDelegate(callback: (() => ?DebuggerDelegate)): void { | ||
this.emitter.on('request-delegate', function(event) { | ||
event.delegate = event.delegate || callback() | ||
}) | ||
} | ||
onDidStart(callback: ((delegate: DebuggerDelegate) => any)): void { | ||
this.emitter.on('did-start', callback) | ||
} | ||
onDidStop(callback: ((delegate: DebuggerDelegate) => any)): void { | ||
this.emitter.on('did-stop', callback) | ||
} | ||
dispose() { | ||
if (this.active) { | ||
this.stop() | ||
} | ||
this.subscriptions.dispose() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* @flow */ | ||
|
||
import { CompositeDisposable } from 'atom' | ||
|
||
import DebuggerDelegate from './delegate' | ||
import validateDebugger from './validate/debugger' | ||
import type { Debugger } from './types' | ||
|
||
export default class DelegateRegistry { | ||
delegates: Set<DebuggerDelegate>; | ||
subscriptions: CompositeDisposable; | ||
|
||
constructor() { | ||
this.delegates = new Set() | ||
this.subscriptions = new CompositeDisposable() | ||
} | ||
register(debugProvider: Debugger): DebuggerDelegate { | ||
if (validateDebugger(debugProvider)) { | ||
throw new Error('Invalid debugger provided') | ||
} | ||
const delegate = new DebuggerDelegate(debugProvider) | ||
this.delegates.add(delegate) | ||
delegate.onDidDestroy(() => { | ||
this.delegates.delete(delegate) | ||
}) | ||
return delegate | ||
} | ||
dispose() { | ||
for (const delegate of this.delegates) { | ||
delegate.dispose() | ||
} | ||
this.subscriptions.dispose() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* @flow */ | ||
|
||
import { Emitter, CompositeDisposable } from 'atom' | ||
import type { Debugger } from './types' | ||
|
||
export default class DebuggerDelegate { | ||
emitter: Emitter; | ||
provider: Debugger; | ||
subscriptions: CompositeDisposable; | ||
|
||
constructor(provider: Debugger) { | ||
this.provider = provider | ||
this.emitter = new Emitter() | ||
this.subscriptions = new CompositeDisposable() | ||
|
||
this.subscriptions.add(this.emitter) | ||
} | ||
get(): Debugger { | ||
return this.provider | ||
} | ||
// Real stuff -- starts | ||
start() { | ||
console.log('start debugger') | ||
} | ||
stop() { | ||
console.log('stop debugger') | ||
} | ||
// Real stuff -- ends | ||
onDidDestroy(callback: (() => any)) { | ||
return this.emitter.on('did-destroy', callback) | ||
} | ||
dispose() { | ||
if (this.subscriptions.isDisposed()) { | ||
return | ||
} | ||
this.emitter.emit('did-destroy') | ||
this.subscriptions.dispose() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* @flow */ | ||
|
||
import { CompositeDisposable, Disposable } from 'atom' | ||
import type { TextEditor } from 'atom' | ||
|
||
export default class Editor { | ||
textEditor: TextEditor; | ||
subscriptions: CompositeDisposable; | ||
|
||
constructor(textEditor: TextEditor) { | ||
this.textEditor = textEditor | ||
this.subscriptions = new CompositeDisposable() | ||
} | ||
onDidDestroy(callback: (() => any)): Disposable { | ||
const subscription = this.textEditor.onDidDestroy(callback) | ||
const disposable = new Disposable(() => { | ||
subscription.dispose() | ||
this.subscriptions.remove(disposable) | ||
}) | ||
this.subscriptions.add(disposable) | ||
return disposable | ||
} | ||
dispose() { | ||
this.subscriptions.dispose() | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @philippvr