Skip to content

Commit

Permalink
DAP UI REPL implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
yyoncho committed Aug 19, 2018
1 parent 749af91 commit c9d1572
Show file tree
Hide file tree
Showing 8 changed files with 291 additions and 116 deletions.
21 changes: 14 additions & 7 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [[#locals][Locals]]
- [[#breakpoints][Breakpoints]]
- [[#keybindings-1][Keybindings]]
- [[#dap-debug-repl][DAP debug REPL]]
- [[#configuration][Configuration]]
- [[#dap-mode-configuration][DAP mode configuration]]
- [[#java][Java]]
Expand Down Expand Up @@ -80,6 +81,7 @@
| ~dap-ui-locals~ | Show locals view |
| ~dap-ui-breakpoints~ | Show breakpoints view |
| ~dap-ui-inspect~ | Inspect |
| ~dap-ui-repl~ | DAP UI REPL |
| ~dap-ui-inspect-region~ | Inspect region |
| ~dap-ui-inspect-thing-at-point~ | Inspect symbol at point |

Expand All @@ -105,6 +107,12 @@
| ~bui-list-mark~ | Mark breakpoint under point | m |
| ~bui-list-unmark~ | Unmark breakpoint under point | u |
| ~bui-list-unmark-all~ | Unmark breakpoint under point | U |
** DAP debug REPL
DAP provides a debug shell to execute command when the program has hit
breakpoints. The REPL has the same features as standart emacs shell (e. g.
command history, ~C-p/n~ navigation through history, etc.) in addition to
optional ~company-mode~ autocompletion.
[[file:screenshots/dap-ui-repl.png]]
* Configuration
** DAP mode configuration
Enable both ~dap-mode~ and ~dap-ui-mode~.
Expand Down Expand Up @@ -141,8 +149,8 @@
(require 'dap-java)

(add-to-list 'lsp-java-bundles (expand-file-name
(locate-user-emacs-file
"eclipse.jdt.ls/plugins/com.microsoft.java.debug.plugin-0.10.0.jar")))
(locate-user-emacs-file
"eclipse.jdt.ls/plugins/com.microsoft.java.debug.plugin-0.10.0.jar")))
#+END_SRC
*** Commands
| Command | Description |
Expand Down Expand Up @@ -185,10 +193,10 @@
conf))

(dap-register-debug-template "Example Configuration"
(list :type "java"
:request "launch"
:args ""
:name "Run Configuration"))
(list :type "java"
:request "launch"
:args ""
:name "Run Configuration"))
#+END_SRC
* Links
- [[https://code.visualstudio.com/docs/extensionAPI/api-debugging][Debug Adapter Protocol]]
Expand All @@ -198,4 +206,3 @@
If you notice a bug, open an issue on Github Issues.
* What's next
- Watches
- Debug console
1 change: 1 addition & 0 deletions changelog.org
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
** Current master
- Added python support
- Added ~dap-hydra~
- Added ~dap-ui-repl~
- Bug fixing.
** v0.1
- Support for managing breakpoints
Expand Down
20 changes: 10 additions & 10 deletions dap-hydra.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;; URL: https://github.com/yyoncho/dap-mode
;; Package-Requires: ((emacs "25.1") (lsp-mode "4.0") (lsp-java "0.1"))
;; Package-Requires: ((emacs "25.1") (hydra "0.14.0"))
;; Version: 0.2
;; Hydra

Expand All @@ -33,19 +33,20 @@

(defhydra dap-hydra (:color pink :hint nil :foreign-keys run)
"
^Stepping^ ^Switch^ ^Breakpoints^ ^Eval
^^^^^^^^-------------------------------------------------------------------------------------
_n_: Next _ss_: Session _bt_: Toggle _ee_: Eval
_i_: Step in _st_: Thread _bd_: Delete _es_: Eval thing at point
_o_: Step out _sf_: Stack frame _ba_: Add _er_: Eval region
_c_: Continue _sl_: List locals _bc_: Set condition _eii_: Inspect
_Q_: Disconnect _sb_: List breakpoints _bh_: Set hit count _eis_: Inspect thing at point
^ ^ _sS_: List sessions _bl_: Set log message _eir_: Inspect region
^Stepping^ ^Switch^ ^Breakpoints^ ^Eval
^^^^^^^^-----------------------------------------------------------------------------------------
_n_: Next _ss_: Session _bt_: Toggle _ee_: Eval
_i_: Step in _st_: Thread _bd_: Delete _er_: Eval region
_o_: Step out _sf_: Stack frame _ba_: Add _es_: Eval thing at point
_c_: Continue _sl_: List locals _bc_: Set condition _eii_: Inspect
_r_: Restart frame _sb_: List breakpoints _bh_: Set hit count _eir_: Inspect region
_Q_: Disconnect _sS_: List sessions _bl_: Set log message _eis_: Inspect thing at point
"
("n" dap-next)
("i" dap-step-in)
("o" dap-step-out)
("c" dap-continue)
("r" dap-restart-frame)
("ss" dap-switch-session)
("st" dap-switch-thread)
("sf" dap-switch-stack-frame)
Expand All @@ -64,7 +65,6 @@ _Q_: Disconnect _sb_: List breakpoints _bh_: Set hit count _eis_: Insp
("eii" dap-ui-inspect)
("eir" dap-ui-inspect-region)
("eis" dap-ui-inspect-thing-at-point)

("q" nil "quit" :color blue)
("Q" dap-disconnect :color red))

Expand Down
Loading

0 comments on commit c9d1572

Please sign in to comment.