Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New function kite-set-script-source

  • Loading branch information...
commit 9e7c56ef5f5e8572ced471820404498bbd2e03c2 1 parent 5f43306
@jscheid authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 kite-debug.el
View
18 kite-debug.el
@@ -237,6 +237,7 @@ correspond to one.")
(define-key map (kbd "C-c u") 'kite-step-out)
(define-key map (kbd "C-c r") 'kite-resume)
(define-key map (kbd "C-c c") 'kite-continue-to-location)
+ (define-key map (kbd "C-c C-c") 'kite-set-script-source)
map)
"Local keymap for the `kite-debugging-mode' minor mode")
@@ -288,6 +289,23 @@ session. Sends `Debugger.stepOut' to the remote debugger."
(line-number-at-pos (point)))
:columnNumber (current-column))))))
+(defun kite-set-script-source ()
+ "Send the buffer contents as the new contents for the script.
+Causes `Debugger.setScriptSource' to be sent to the remote
+debugger."
+ (interactive)
+ (kite-send "Debugger.setScriptSource"
+ :params
+ (list :scriptId kite-script-id
+ :scriptSource (save-restriction
+ (widen)
+ (buffer-string))
+ :preview :json-false)
+ :success-function
+ (lambda (result)
+ ;; FIXME: use :callFrames to update context information
+ (message "Script updated"))))
+
(defun kite--create-remote-script-buffer (script-info
after-load-function)
(lexical-let* ((url (kite-script-info-url script-info))
Please sign in to comment.
Something went wrong with that request. Please try again.