From 73ea1b1dab640c1401f8953f9c93eccf0db57e29 Mon Sep 17 00:00:00 2001 From: Priyank Desai Date: Wed, 26 Aug 2015 14:16:17 -0700 Subject: [PATCH] Fix to update correct line numbers in scope window, when debugging a sourcemapped file. --- swi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/swi.py b/swi.py index 914d105..bfbd561 100644 --- a/swi.py +++ b/swi.py @@ -874,7 +874,7 @@ def change_to_call_frame(callFrame): file_name = find_script(str(scriptId)) first_scope = callFrame.scopeChain[0] - params = {'objectId': first_scope.object.objectId, 'name': "%s:%s (%s)" % (file_name, line_number, first_scope.type)} + params = {'objectId': first_scope.object.objectId, 'name': "%s:(%s, %s) (%s)" % (file_name, line_number, callFrame.location.columnNumber, first_scope.type)} channel.send(webkit.Runtime.getProperties(first_scope.object.objectId, True), console_add_properties, params) position = get_authored_position_if_necessary(file_name, callFrame.location.lineNumber, callFrame.location.columnNumber) @@ -1047,14 +1047,16 @@ def run(self, edit): if 'file' in command.options and 'line' in command.options: file = command.options['file'] line = command.options['line'] + column = command.options['column'] if 'column' in command.options else "0" else: # eg., name can be # c:\foo\bar\baz.js:422 (local) - p = re.compile("^\s*(?P.+)\s*:\s*(?P\d+)(?P\s+.*)$") + p = re.compile("^\s*(?P.+)\s*:\(\s*(?P\d+),\s*(?P\d+)\)(?P\s+.*)$") m = p.search(name) if m: file = m.group('file') line = m.group('line') + column = m.group('column') name = m.group('remainder') else: file = "" @@ -1068,7 +1070,7 @@ def run(self, edit): v.erase(edit, sublime.Region(0, v.size())) if file and line: - position = get_authored_position_if_necessary(file, int(line), 0) + position = get_authored_position_if_necessary(file, int(line), int(column)) if position: file = position.file_name() line = position.one_based_line()