Skip to content

Commit

Permalink
Package update:
Browse files Browse the repository at this point in the history
Fixed: Did not work on Sublime Text 2 due to making communication with debugger engine asynchronous. (fix #34)
Fixed: Would show invalid values in output due to incorrect decoding. (fix #35)
Added option for settings to command palette and changed menu order.
  • Loading branch information
martomo committed Sep 18, 2013
1 parent 57189d1 commit 1cba552
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 83 deletions.
5 changes: 2 additions & 3 deletions Context.sublime-menu
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[
{
"caption": "Xdebug",
"mnemonic": "X",
"id": "xdebug",
"children": [
"children":
[
{
"caption": "Add/Remove Breakpoint",
"command": "xdebug_breakpoint"
Expand Down
9 changes: 9 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,14 @@
"caption": "Xdebug: Restore Layout",
"command": "xdebug_layout",
"args" : {"restore" : true}
},
{
"caption": "Preferences: Xdebug Settings – Default",
"command": "xdebug_settings"
},
{
"caption": "Preferences: Xdebug Settings – User",
"command": "open_file",
"args" : {"file" : "${packages}/User/Xdebug.sublime-settings"}
}
]
19 changes: 12 additions & 7 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"id": "tools",
"children":
[
{
"id": "end"
},
{
"caption": "Xdebug",
"mnemonic": "X",
"id": "xdebug",
"children": [
"children":
[
{
"caption": "Start Debugging",
"command": "xdebug_session_start"
Expand Down Expand Up @@ -140,25 +142,28 @@
{
"caption": "Settings - User",
"command": "open_file",
"args" : {"file": "${packages}/User/Xdebug.sublime-settings"}
"args" : {"file" : "${packages}/User/Xdebug.sublime-settings"}
}
]
}
]
},
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children": [
"children":
[
{
"caption": "Xdebug",
"mnemonic": "X",
"children": [
"children":
[
{
"caption": "Settings – Default",
"command": "xdebug_settings"
Expand Down
13 changes: 7 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def run(self, launch_browser=False, restart=False):
S.SESSION_BUSY = False
S.BREAKPOINT_ROW = None
S.CONTEXT_DATA.clear()
async_session = session.SocketHandler(session.ACTION_WATCH, check_debug_view=True)
async_session = session.SocketHandler(session.ACTION_WATCH, has_watch_view=V.has_debug_view(V.TITLE_WINDOW_WATCH))
async_session.start()
# Remove temporary breakpoint
if S.BREAKPOINT_RUN is not None and S.BREAKPOINT_RUN['filename'] in S.BREAKPOINT and S.BREAKPOINT_RUN['lineno'] in S.BREAKPOINT[S.BREAKPOINT_RUN['filename']]:
Expand All @@ -227,7 +227,8 @@ def listen(self):

def connected(self):
sublime.status_message('Xdebug: Connected')
async_session = session.SocketHandler(session.ACTION_INIT)

async_session = session.SocketHandler(session.ACTION_INIT, max_depth=S.get_config_value('max_depth'), max_children=S.get_config_value('max_children'), break_on_start=S.get_config_value('break_on_start'), super_globals=S.get_config_value('super_globals'))
async_session.start()

def is_enabled(self):
Expand Down Expand Up @@ -257,7 +258,7 @@ def run(self, close_windows=False, launch_browser=False, restart=False):
S.SESSION_BUSY = False
S.BREAKPOINT_ROW = None
S.CONTEXT_DATA.clear()
async_session = session.SocketHandler(session.ACTION_WATCH, check_debug_view=True)
async_session = session.SocketHandler(session.ACTION_WATCH, has_watch_view=V.has_debug_view(V.TITLE_WINDOW_WATCH))
async_session.start()
# Remove temporary breakpoint
if S.BREAKPOINT_RUN is not None and S.BREAKPOINT_RUN['filename'] in S.BREAKPOINT and S.BREAKPOINT_RUN['lineno'] in S.BREAKPOINT[S.BREAKPOINT_RUN['filename']]:
Expand Down Expand Up @@ -300,7 +301,7 @@ class XdebugExecuteCommand(sublime_plugin.WindowCommand):
command -- Command to send to debugger engine.
"""
def run(self, command=None):
async_session = session.SocketHandler(session.ACTION_EXECUTE, command=command)
async_session = session.SocketHandler(session.ACTION_EXECUTE, command=command, super_globals=S.get_config_value('super_globals'))
async_session.start()

def is_enabled(self):
Expand Down Expand Up @@ -366,7 +367,7 @@ def run(self):
self.window.show_input_panel('Evaluate', '', self.on_done, self.on_change, self.on_cancel)

def on_done(self, expression):
async_session = session.SocketHandler(session.ACTION_EVALUATE, expression=expression)
async_session = session.SocketHandler(session.ACTION_EVALUATE, expression=expression, pretty_output=S.get_config_value('pretty_output'))
async_session.start()

def on_change(self, expression):
Expand Down Expand Up @@ -492,7 +493,7 @@ def set_expression(self):
self.window.show_input_panel('Watch expression', '', self.on_done, self.on_change, self.on_cancel)

def update_view(self):
async_session = session.SocketHandler(session.ACTION_WATCH, check_debug_view=True)
async_session = session.SocketHandler(session.ACTION_WATCH, has_watch_view=V.has_debug_view(V.TITLE_WINDOW_WATCH))
async_session.start()
# Save watch data to file
util.save_watch_data()
Expand Down
Loading

0 comments on commit 1cba552

Please sign in to comment.