Browse Source

Sort scripts by parse time

To make sure the latest sourcemap gets picked up when debugging, sort scripts by
parse time.
workspaces
Nicolas Petton 3 years ago
parent
commit
e3586e51db
2 changed files with 9 additions and 3 deletions
  1. +8
    -3
      indium-script.el
  2. +1
    -0
      indium-structs.el

+ 8
- 3
indium-script.el View File

@ -92,9 +92,14 @@ Return nil if no script can be found."
(not (seq-empty-p sourcemap-url))))
(defun indium-script-all-scripts-with-sourcemap ()
"Return all parsed scripts that contain a sourcemap."
(seq-filter #'indium-script-has-sourcemap-p
(map-values (indium-current-connection-scripts))))
"Return all parsed scripts that contain a sourcemap.
The scripts are sorted by parsed time, to ensure the newest
script is picked up first when using sourcemaps."
(seq-sort (lambda (a b)
(not (time-less-p (indium-script-parsed-time a)
(indium-script-parsed-time b))))
(seq-filter #'indium-script-has-sourcemap-p
(map-values (indium-current-connection-scripts)))))
(defun indium-script-get-frame-original-location (frame)
"Return the location stack FRAME, possibly using sourcemaps."


+ 1
- 0
indium-structs.el View File

@ -186,6 +186,7 @@ If LINE is not provided, return all breakpoints in FILE."
(id nil :type string :read-only t)
(url nil :type string :read-only t)
(sourcemap-url nil :type string :read-only t)
(parsed-time (current-time) :read-only t)
;; Keep a cache of the parsed sourcemap for speed. See
;; `indium-script-sourcemap'.
(sourcemap-cache nil))


Loading…
Cancel
Save