Browse Source

Add support for menus

workspaces
Nicolas Petton 4 years ago
parent
commit
28d081ef1f
Signed by: nico GPG Key ID: 233587A47C207910
3 changed files with 47 additions and 0 deletions
  1. +19
    -0
      indium-debugger.el
  2. +18
    -0
      indium-interaction.el
  3. +10
    -0
      indium-repl.el

+ 19
- 0
indium-debugger.el View File

@ -26,6 +26,9 @@
(require 'seq)
(require 'map)
(require 'easymenu)
(require 'indium-inspector)
(require 'indium-repl)
(require 'indium-interaction)
@ -68,6 +71,22 @@
(define-key map (kbd "e") #'indium-debugger-evaluate)
(define-key map (kbd "n") #'indium-debugger-next-frame)
(define-key map (kbd "p") #'indium-debugger-previous-frame)
(easy-menu-define indium-debugger-mode-menu map
"Menu for Indium debugger"
'("Indium Debugger"
["Resume" indium-debugger-resume]
["Step over" indium-debugger-step-over]
["Step into" indium-debugger-step-into]
["Step out" indium-debugger-step-out]
["Jump here" indium-debugger-here]
"--"
["Inspect locals" indium-debugger-locals]
["Show stack" indium-debugger-stack-frames]
"--"
["Evaluate" indium-debugger-evaluate]
"--"
["Jump to the next frame" indium-debugger-next-frame]
["Jump to the previous frame" indium-debugger-previous-frame]))
map))
(define-minor-mode indium-debugger-mode


+ 18
- 0
indium-interaction.el View File

@ -29,6 +29,7 @@
(require 'map)
(require 'seq)
(require 'subr-x)
(require 'easymenu)
(require 'indium-backend)
(require 'indium-inspector)
@ -200,6 +201,23 @@ hitting a breakpoint."
(define-key map (kbd "C-c b K") #'indium-remove-all-breakpoints-from-buffer)
(define-key map (kbd "C-c b a") #'indium-activate-breakpoints)
(define-key map (kbd "C-c b d") #'indium-deactivate-breakpoints)
(easy-menu-define indium-interaction-mode-menu map
"Menu for Indium interaction mode"
'("Indium interaction"
["Switch to REPL" indium-switch-to-repl-buffer]
"--"
("Evaluation"
["Evaluate last node" indium-eval-last-node]
["Inspect last node" indium-inspect-last-node]
["Evaluate function" indium-eval-defun])
"--"
("Breakpoints"
["Add breakpoint" indium-add-breakpoint]
["Add conditional breakpoint" indium-add-conditional-breakpoint]
["Remove breakpoint" indium-remove-breakpoint]
["Remove all breakpoints" indium-remove-all-breakpoints-from-buffer]
["Deactivate breakpoints" indium-deactivate-breakpoints]
["Activate breakpoints" indium-activate-breakpoints])))
map))
(define-minor-mode indium-interaction-mode


+ 10
- 0
indium-repl.el View File

@ -29,6 +29,7 @@
(require 'indium-backend)
(require 'company)
(require 'easymenu)
(require 'map)
(require 'js)
@ -399,6 +400,15 @@ Evaluate CALLBACK with the completion candidates."
(define-key map (kbd "C-c C-q") #'indium-quit)
(define-key map (kbd "M-p") #'indium-repl-previous-input)
(define-key map (kbd "M-n") #'indium-repl-next-input)
(easy-menu-define indium-repl-mode-menu map
"Menu for Indium REPL"
'("Indium REPL"
["Clear output" indium-repl-clear-output]
["Inspect" indium-repl-inspect]
"--"
["Switch to source buffer" indium-repl-pop-buffer]
"--"
["Quit" indium-quit]))
map))
(define-derived-mode indium-repl-mode fundamental-mode "JS-REPL"


Loading…
Cancel
Save