Skip to content

Commit 73ea1b1

Browse files
committed
Fix to update correct line numbers in scope window, when debugging a sourcemapped file.
1 parent b1302ca commit 73ea1b1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

swi.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ def change_to_call_frame(callFrame):
874874
file_name = find_script(str(scriptId))
875875
first_scope = callFrame.scopeChain[0]
876876

877-
params = {'objectId': first_scope.object.objectId, 'name': "%s:%s (%s)" % (file_name, line_number, first_scope.type)}
877+
params = {'objectId': first_scope.object.objectId, 'name': "%s:(%s, %s) (%s)" % (file_name, line_number, callFrame.location.columnNumber, first_scope.type)}
878878
channel.send(webkit.Runtime.getProperties(first_scope.object.objectId, True), console_add_properties, params)
879879

880880
position = get_authored_position_if_necessary(file_name, callFrame.location.lineNumber, callFrame.location.columnNumber)
@@ -1047,14 +1047,16 @@ def run(self, edit):
10471047
if 'file' in command.options and 'line' in command.options:
10481048
file = command.options['file']
10491049
line = command.options['line']
1050+
column = command.options['column'] if 'column' in command.options else "0"
10501051
else:
10511052
# eg., name can be
10521053
# c:\foo\bar\baz.js:422 (local)
1053-
p = re.compile("^\s*(?P<file>.+)\s*:\s*(?P<line>\d+)(?P<remainder>\s+.*)$")
1054+
p = re.compile("^\s*(?P<file>.+)\s*:\(\s*(?P<line>\d+),\s*(?P<column>\d+)\)(?P<remainder>\s+.*)$")
10541055
m = p.search(name)
10551056
if m:
10561057
file = m.group('file')
10571058
line = m.group('line')
1059+
column = m.group('column')
10581060
name = m.group('remainder')
10591061
else:
10601062
file = ""
@@ -1068,7 +1070,7 @@ def run(self, edit):
10681070
v.erase(edit, sublime.Region(0, v.size()))
10691071

10701072
if file and line:
1071-
position = get_authored_position_if_necessary(file, int(line), 0)
1073+
position = get_authored_position_if_necessary(file, int(line), int(column))
10721074
if position:
10731075
file = position.file_name()
10741076
line = position.one_based_line()

0 commit comments

Comments
 (0)