Skip to content

Commit

Permalink
Merge pull request #274 from gwomacks/debug-ui-rewrite
Browse files Browse the repository at this point in the history
Rewrite most of package to use atom-debug-ui, convert to JS from coffee
  • Loading branch information
cchamplin committed May 3, 2018
2 parents 9c5b595 + a300628 commit c0dfd36
Show file tree
Hide file tree
Showing 58 changed files with 4,126 additions and 3,120 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,20 @@
## 0.3.0
* Almost a complete rewrite
* Utilize atom-debug-ui package
* UTF-8 Support for member names and data
* Support for multiple debug sessions/instances
* New pathmaps functionality, old style is replaced
* Better status messages
* More options for UI tweeks

* Via atom-debug-ui: A huge number of UI cleanups
* Via atom-debug-ui: Support for Atom dock functionality
* Via atom-debug-ui: Floating/Overlay Actionbar
* Via atom-debug-ui: Better access to settings for breakpoints
* Via atom-debug-ui: Better highlighting for variables
* Via atom-debug-ui: Better status messages
* Via atom-debug-ui: Better console support

## 0.2.6
* Fix bug(s) with new socket binding code, should fix Atom freezes
* Fix for scrollbar styling [thanks pictus]
Expand Down
51 changes: 31 additions & 20 deletions README.md
Expand Up @@ -3,14 +3,19 @@
Debug PHP code using the [Xdebug PHP Extension](http://xdebug.org/).

# Features
- Add Breakpoints
- Interactive Console
- Breakpoints
- Watches
- Multiple Debug Sessions
- Path Mappings
- Step through debugging (Over, In, Out)
- Stack and Context views
- Add Watchpoints to inspect current values of variables
- UTF8 Support
- Uses atom-debug-ui

This is currently an alpha release, and still in active development.

![](https://raw.githubusercontent.com/gwomacks/php-debug/master/screenshot.png)
![](https://raw.githubusercontent.com/gwomacks/php-debug/master/screenshot.gif)

# Getting Started

Expand Down Expand Up @@ -51,28 +56,14 @@ To begin debugging:

Move the cursor to a line you want to break on and set a breakpoint by pressing `Alt+F9`, selecting Toggle Breakpoint from the Command Palette (`ctrl+shift+p`)or with the php-debug menu (`Packages -> php-debug->Toggle Breakpoint`).
This will highlight the line number green, to indicate the presence of a breakpoint.

3. Open the debug view by pressing `ctrl+alt+d`, selecting 'Toggle Debugging' from the Command Palette or php-debug menu.
4. Start the script with Xdebug enabled. If everything is setup correctly, the entire line of the breakpoint will be highlighted in green, indicating the current line of the script.

If everything worked correctly, you can now use the various buttons/commands to step through the script.

# Settings

Put the following in your config.cson from File -> Config...
```cson
"php-debug":
{
ServerPort: 9000
ServerAddress: "127.0.0.1"
PathMaps: [
"remotepath;localpath"
"/base/path/on/remote/system;C:\\base\\path\\on\\local\\system"
]
}
```
Be sure to indent it under "*"

### Server Port ###
This is the port that the atom client will listen on.
Defaults to 9000
Expand All @@ -81,6 +72,26 @@ Defaults to 9000
This is the address that the atom client will listen on.
Defaults to 127.0.0.1

### Xdebug DBGP Protocol Debugging ###
Outputs protocol debugging messages to the atom debug console

### Xdebug: Max Depth ###
Max depth for variable scopes

### Xdebug: Max children ###
Maximum number of array elements to show in variables

### Xdebug: Max Data ###
Maximum data for variables

### Display: Sort Arrays/Object alphabetically ###
Sort Arrays/Object alphabetically instead of by php default

### Display: Status Bar ###
Allow PHP Debug to be opened from the status bar

### Exceptions ###
Default exceptions and errors for PHP-Debug to break on

### Path Maps ###
If debugging code that resides on a remote machine, use pathmaps to map a path
on the remote machine to a path on the local machine.
Pathmaps are now configured for each project folder during connection
23 changes: 8 additions & 15 deletions keymaps/php-debug.cson
Expand Up @@ -8,35 +8,28 @@
# For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'atom-workspace':
'ctrl-alt-d': 'php-debug:toggleDebugging'
'ctrl-alt-w': 'php-debug:addWatch'
'alt-f9': 'php-debug:toggleBreakpoint'
'alt-f5': 'php-debug:run'
'alt-f6': 'php-debug:stepOver'
'alt-f7': 'php-debug:stepIn'
'alt-f8': 'php-debug:stepOut'

# Add more specific keymap overrides for php files
"atom-text-editor[data-grammar='text html php']":
'ctrl-alt-d': 'php-debug:toggleDebugging'
'ctrl-alt-w': 'php-debug:addWatch'
'alt-f9': 'php-debug:toggleBreakpoint'
'ctrl-alt-d': 'atom-debug-ui:toggleDebugging'
'ctrl-alt-f': 'atom-debug-ui:addWatch'
'ctrl-alt-w': 'atom-debug-ui:addWatchpoint'
'alt-f9': 'atom-debug-ui:toggleBreakpoint'
'alt-f5': 'php-debug:run'
'alt-f6': 'php-debug:stepOver'
'alt-f7': 'php-debug:stepIn'
'alt-f8': 'php-debug:stepOut'

'.php-debug':
'ctrl-alt-d': 'php-debug:toggleDebugging'
'ctrl-alt-w': 'php-debug:addWatch'
'alt-f9': 'php-debug:toggleBreakpoint'
'ctrl-alt-d': 'atom-debug-ui:toggleDebugging'
'ctrl-alt-f': 'atom-debug-ui:addWatch'
'ctrl-alt-w': 'atom-debug-ui:addWatchpoint'
'alt-f9': 'atom-debug-ui:toggleBreakpoint'
'alt-f5': 'php-debug:run'
'alt-f6': 'php-debug:stepOver'
'alt-f7': 'php-debug:stepIn'
'alt-f8': 'php-debug:stepOut'

'atom-workspace .php-debug-console atom-text-editor':
'alt-up': 'php-debug:navigatePreviousConsoleCommand'
'alt-down': 'php-debug:navigateNextConsoleCommand'
'up': 'php-debug:navigatePreviousConsoleCommand'
'down': 'php-debug:navigateNextConsoleCommand'
19 changes: 0 additions & 19 deletions lib/breakpoint/breakpoint-item-view.coffee

This file was deleted.

39 changes: 0 additions & 39 deletions lib/breakpoint/breakpoint-list-view.coffee

This file was deleted.

26 changes: 0 additions & 26 deletions lib/breakpoint/breakpoint-settings-condition-view.coffee

This file was deleted.

62 changes: 0 additions & 62 deletions lib/breakpoint/breakpoint-settings-view.coffee

This file was deleted.

16 changes: 0 additions & 16 deletions lib/breakpoint/breakpoint-view.coffee

This file was deleted.

45 changes: 0 additions & 45 deletions lib/breakpoint/php-debug-breakpoint-view.coffee

This file was deleted.

31 changes: 31 additions & 0 deletions lib/breakpoints/default-breakpoint-item-view.js
@@ -0,0 +1,31 @@
'use babel'
/** @jsx etch.dom */

import etch from 'etch'
import UiComponent from '../ui/component'

export default class DefaultBreakpointItemView extends UiComponent {

render () {
const {breakpoint,type,status} = this.props;
let attributes = {
value: type
};
if (status == true) {
attributes.checked = "checked";
}
return <li className='breakpoint-list-item'>
<div className='breakpoint-item'>
<input type="checkbox" className='input-checkbox breakpoint-enabled' onchange={this.handleChange} attributes={attributes} />
<span className='breakpoint-type'>{breakpoint.title}</span>
</div>
</li>
}
handleChange (event) {
if (!this.props.onchange) {
return
}
this.props.onchange(this.props.type, event.target.checked);
}
}
DefaultBreakpointItemView.bindFns = ["handleChange"]

0 comments on commit c0dfd36

Please sign in to comment.