Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gwomacks committed Apr 28, 2015
1 parent 2d7520a commit aff66f3
Show file tree
Hide file tree
Showing 31 changed files with 921 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
.DS_Store
npm-debug.log
node_modules
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,3 @@
## 0.1.0 - First Release
* Every feature added
* Every bug fixed
20 changes: 20 additions & 0 deletions LICENSE.md
@@ -0,0 +1,20 @@
Copyright (c) 2015 <Your name here>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
@@ -0,0 +1,5 @@
# php-debug package

A short description of your package.

![A screenshot of your package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif)
12 changes: 12 additions & 0 deletions keymaps/php-debug.cson
@@ -0,0 +1,12 @@
# Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.

# For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'atom-workspace':
'ctrl-alt-d': 'php-debug:toggleDebugging'
'alt-f9': 'php-debug:toggleBreakpoint'
18 changes: 18 additions & 0 deletions lib/breakpoint/breakpoint-item-view.coffee
@@ -0,0 +1,18 @@
{View} = require 'atom'

module.exports =
class BreakpointItemView extends View
@content: =>
@li class: 'meow', =>
@div class: 'meow', =>
@span outlet: 'path'
@span outlet: 'line'

initialize: (breakpoint) ->
@breakpoint = breakpoint
@render()

render: ->
console.log "Rendering variable"
@path.append @breakpoint.getPath()
@line.append @breakpoint.getLine()
18 changes: 18 additions & 0 deletions lib/breakpoint/breakpoint-list-view.coffee
@@ -0,0 +1,18 @@
{View} = require 'atom'
BreakpointItemView = require './breakpoint-item-view'

module.exports =
class BreakpointListView extends View

@content: =>
@ul class: "breakpoint-list-view", =>
@div outlet: "breakpointItemList"

initialize: (breakpoints) ->
@breakpoints = breakpoints
@render()

render: ->
for breakpoint in @breakpoints
console.log breakpoint.getLine()
@breakpointItemList.append(new BreakpointItemView(breakpoint))
17 changes: 17 additions & 0 deletions lib/breakpoint/breakpoint-view.coffee
@@ -0,0 +1,17 @@
{View} = require 'atom'
BreakpointListView = require './breakpoint-list-view'

module.exports =
class BreakpointView extends View

@content: =>
@div class: 'thing', =>
@div outlet: 'breakpointListView'

initialize: (breakpoints) ->
@breakpoints = breakpoints
@render()

render: ->
@breakpointListView.append(new BreakpointListView(@breakpoints))
#@contextListView.append "List View"
39 changes: 39 additions & 0 deletions lib/breakpoint/php-debug-breakpoint-view.coffee
@@ -0,0 +1,39 @@
{Disposable} = require 'atom'
{$, ScrollView} = require 'atom-space-pen-views'
BreakpointView = require './breakpoint-view'

GlobalContext = require '../models/global-context'

module.exports =
class PhpDebugBreakpointView extends ScrollView
@content: ->
@div class: 'php-debug php-debug-breakpoint-view pane-item native-key-bindings padded', tabindex: -1, =>
@div outlet: 'breakpointViewList', class:'php-debug-breakpoints'

constructor: ->
super()
@contextList = []

serialize: ->
deserializer: @constructor.name
uri: @getURI()

getURI: -> @uri

getTitle: -> "Breakpoints"

onDidChangeTitle: -> new Disposable ->
onDidChangeModified: -> new Disposable ->

isEqual: (other) ->
other instanceof PhpDebugBreakpointView

initialize: ->
@showBreakpoints()

showBreakpoints: ->
@breakpointViewList.empty()
breakpoints = GlobalContext.getBreakpoints()
console.log "Showing breakpoints"
console.log "" + breakpoints.length + " found"
@breakpointViewList.append(new BreakpointView(breakpoints))
21 changes: 21 additions & 0 deletions lib/context/context-variable-list-view.coffee
@@ -0,0 +1,21 @@
{View} = require 'atom'
ContextVariableView = require './context-variable-view'

module.exports =
class ContextVariableListView extends View

@content: =>
@ul class: "context-variable-list-view", =>
@div outlet: "contextVariableList"

initialize: (variables) ->
@variables = variables
console.dir @variables
console.log "Constructed"
@render()

render: ->
for variable in @variables
console.log "adding variable"
@contextVariableList.append(new ContextVariableView(variable))
#@variableListView.append "moo"
27 changes: 27 additions & 0 deletions lib/context/context-variable-view.coffee
@@ -0,0 +1,27 @@
{View} = require 'atom'

module.exports =
class ContextVariableView extends View
@content: =>
@li class: 'meow', =>
@div class: 'meow', =>
@span outlet: 'name'
@span outlet: 'value'

initialize: (variable) ->
@variable = variable
@render()

render: ->
console.log "Rendering variable"
@name.append @variable.fullname
switch @variable.type
when 'string' then @value.append @variable.value
when 'uninitialized' then @value.append "?"
when 'array'
ContextVariableListView = require "./context-variable-list-view"
@value.append("array("+@variable.value.length+")")
@value.append(new ContextVariableListView(@variable.value))
#@value.append "ARRAY"
else
console.log "Unhandled variable type: " + @variable.type
21 changes: 21 additions & 0 deletions lib/context/context-view.coffee
@@ -0,0 +1,21 @@
{View} = require 'atom'
ContextVariableListView = require './context-variable-list-view'

module.exports =
class ContextView extends View

@content: =>
@div class: 'thing', =>
@div outlet: 'contextListView'

initialize: (context) ->
@context = context
console.dir @context
console.log "Constructed"
@render()

render: ->
console.dir @context
console.log "rendering"
@contextListView.append(new ContextVariableListView(@context.context.variables))
#@contextListView.append "List View"
2 changes: 2 additions & 0 deletions lib/context/context.coffee
@@ -0,0 +1,2 @@
module.exports =
class Context
40 changes: 40 additions & 0 deletions lib/context/php-debug-context-view.coffee
@@ -0,0 +1,40 @@
{Disposable} = require 'atom'
{$, ScrollView} = require 'atom-space-pen-views'
ContextView = require './context-view'

module.exports =
class PhpDebugContextView extends ScrollView
@content: ->
@div class: 'php-debug php-debug-context-view pane-item native-key-bindings padded', tabindex: -1, =>
@button class: 'btn btn-collapse-all', 'Collapse All Sections'
@div outlet: 'contextViewList', class:'php-debug-contexts'

constructor: ->
super()
@contextList = []

serialize: ->
deserializer: @constructor.name
uri: @getURI()

getURI: -> @uri

getTitle: -> "Context"

onDidChangeTitle: -> new Disposable ->
onDidChangeModified: -> new Disposable ->

isEqual: (other) ->
other instanceof PhpDebugContextView

setDebugContext: (context) ->
@debugContext = context
@showContexts()

showContexts: ->
@contextViewList.empty()
for index, context of @debugContext.scopeList
console.dir context
if context == undefined
continue
@contextViewList.append(new ContextView(context))

0 comments on commit aff66f3

Please sign in to comment.