Browse Source

Make server send the id along with each call frame

* indium-structs.el (indium-frame): Add an id field.
* server/adapters/cdp/helpers.js: When sending a call frame, also
  sends its id.
run-to-here
Damien Cassou 3 years ago
committed by Nicolas Petton
parent
commit
e10b13d16f
3 changed files with 8 additions and 3 deletions
  1. +2
    -0
      indium-structs.el
  2. +2
    -1
      server/adapters/cdp/helpers.js
  3. +4
    -2
      test/unit/indium-structs-test.el

+ 2
- 0
indium-structs.el View File

@ -97,6 +97,7 @@
scope-chain))
(:constructor indium-frame-from-alist
(alist &aux
(id (map-elt alist 'id))
(script-id (map-elt alist 'scriptId))
(function-name (map-elt alist 'functionName))
(location (indium-location-from-alist
@ -104,6 +105,7 @@
(scope-chain (seq-map #'indium-scope-from-alist
(map-elt alist 'scopeChain)))))
(:copier nil))
(id "" :type string)
(function-name "" :type string)
(script-id "" :type string)
(location nil :type indium-location)


+ 2
- 1
server/adapters/cdp/helpers.js View File

@ -127,7 +127,7 @@ const convertCallFrames = async (frames, conf, scripts) => {
};
const convertCallFrame = async (
{ functionName, location, scopeChain },
{ functionName, location, scopeChain, callFrameId },
conf,
scripts
) => {
@ -139,6 +139,7 @@ const convertCallFrame = async (
return {
functionName,
id: callFrameId,
scriptId: location.scriptId,
location: fileLocation,
scopeChain: scopeChain


+ 4
- 2
test/unit/indium-structs-test.el View File

@ -91,8 +91,9 @@
(describe "Frames"
(it "Should be able to make frames from alists"
(let ((f (indium-frame-from-alist '((scriptId . "22")
(functionName . "foo")
(let ((f (indium-frame-from-alist '((id . "some id")
(scriptId . "22")
(functionName . "foo")
(location . ((file . "index.js")
(line . 22)
(column . 0)))
@ -102,6 +103,7 @@
((type . "local")
(name . "bar")
(id . "26"))])))))
(expect (indium-frame-id f) :to-equal "some id")
(expect (indium-frame-script-id f) :to-equal "22")
(expect (indium-frame-function-name f) :to-equal "foo")
(expect (length (indium-frame-scope-chain f)) :to-equal 2)


Loading…
Cancel
Save