Giter Club home page Giter Club logo

dap-mode's Introduction

title description root_file
LSP Mode - Language Server Protocol support for Emacs
Language Server Protocol support with multiples languages support for Emacs
README.md

CI

Language Server Protocol Support for Emacs

LSP mode


homepageinstallationlanguagessettingstutorialstroubleshootingscreenshotsFAQ


Why?

  • ❤️ Community Driven
  • 💎 Fully featured - supports all features in Language Server Protocol v3.14.
  • 🚀 Fast - see performance section.
  • 🌟 Flexible - choose between full-blown IDE with flashy UI or minimal distraction free.
  • ⚙️ Easy to configure - works out of the box and automatically upgrades if additional packages are present.

Overview

Client for Language Server Protocol (v3.14). lsp-mode aims to provide IDE-like experience by providing optional integration with the most popular Emacs packages like company, flycheck and projectile.

  • Non-blocking asynchronous calls
  • Real-time Diagnostics/linting via flycheck (recommended) or flymake when Emacs > 26 (requires flymake>=1.0.5)
  • Code completion - company-capf / completion-at-point (note that company-lsp is no longer supported).
  • Hovers - using lsp-ui
  • Code actions - via lsp-execute-code-action, modeline (recommended) or lsp-ui sideline.
  • Code outline - using builtin imenu or helm-imenu
  • Code navigation - using builtin xref, lsp-treemacs tree views or lsp-ui peek functions.
  • Code lens
  • Symbol highlights
  • Formatting
  • Project errors on modeline
  • Debugger - dap-mode
  • Breadcrumb on headerline
  • Helm integration - helm-lsp
  • Ivy integration - lsp-ivy
  • Consult integration - consult-lsp
  • Treemacs integration - lsp-treemacs
  • Semantic tokens as defined by LSP 3.16 (compatible language servers include recent development builds of clangd and rust-analyzer)
  • which-key integration for better discovery
  • iedit
  • dired
  • ido

Presentations/demos

See also

  • lsp-docker - provide docker image with preconfigured language servers with corresponding emacs configuration.
  • company-box - company frontend with icons.
  • dap-mode - Debugger integration for lsp-mode.
  • eglot - An alternative minimal LSP implementation.
  • which-key - Emacs package that displays available keybindings in popup
  • projectile - Project Interaction Library for Emacs
  • emacs-tree-sitter - Faster, fine-grained code highlighting via tree-sitter.
  • gccemacs - modified Emacs capable of compiling and running Emacs Lisp as native code.

Contributions

Contributions are very much welcome!

NOTE Documentation for clients is generated from doc comments in the clients themselves (see lsp-doc.el) and some metadata (see lsp-clients.json) so please submit corrections accordingly.

Support the project

The emacs-lsp organization has more than 20,000 lines of code, to keep all of this working, we need to implement new features and help the community on a lot of issues.

You can help us keep going and improving it by supporting the project

Members

Here it is a list of the current lsp-mode members and what they are primary working on/responsible for.

kurnevsky
kurnevsky

Scala | Rust
seagle0128
seagle0128

Go | Python MS
sebastiansturm
sebastiansturm

lsp-mode core | C++
vibhavp
vibhavp

lsp-mode core
yyoncho
yyoncho

lsp-mode core | Java
ericdallo
ericdallo

Dart/Flutter | Clojure
danielmartin
danielmartin

C++ | Swift
kiennq
kiennq

completions | pwsh
nbfalcon
nbfalcon

lsp-mode core | iedit
psibi
psibi

Terraform | Nix
razzmatazz
razzmatazz

C# | F#
jcs090218
jcs090218

lsp-mode core

dap-mode's People

Contributors

abougouffa avatar apmattil avatar dakra avatar danielmartin avatar dvzubarev avatar ericdallo avatar eshelyaron avatar f279801 avatar gagbo avatar genegoykhman avatar iri-e avatar jcs090218 avatar jrwats avatar kiennq avatar kurnevsky avatar leungbk avatar mainek00n avatar nbfalcon avatar r-darwish avatar s-kostyaev avatar samhedin avatar sfavazza avatar taupan avatar themkat avatar timfel avatar tinloaf avatar tomterl avatar wangnangg avatar wyuenho avatar yyoncho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dap-mode's Issues

Redefine class in Java

I think this is not specific to dap-mode but I am looking for a method to accomplish the following.

While attached with jdb to a Java process, you can reload a class by typing in the REPL:

> redefine <class id> <class file name>
                          -- redefine the code for a class

The problem is that once a debugger has been attached to the process (dap-mode, for instance), no further debuggers can attach. The error subsequent debuggers receive is "Connection refused".

So, the problem is that I can no longer redefine Java classes unless I do it from dap-mode.
However, I could not find a way to accomplish this after reading the official specification.

Error shows "Cannot evaluate, please specify projectName in launch.json" when trying to attach debug Java

When trying to attach java debug to running springboot process, it successes, and break point is hit, program also stops on the breakpoint line.

But when trying to evaluate an variable or do other debug command, exception like below shows up:

The below exception was thrown when trying to evaluate a local variable

Exception as below:

Cannot evalution expression because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json..
com.microsoft.java.debug.core.DebugException: Cannot evalution expression because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.\
json..
  at com.microsoft.java.debug.core.adapter.AdapterUtils.createCompletionException(AdapterUtils.java:227)
  at com.microsoft.java.debug.core.adapter.handler.EvaluateRequestHandler.lambda$handle$0(EvaluateRequestHandler.java:103)
  at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
  at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582)
  at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
  at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
  at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
  at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json.
  at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.findJavaProjectByStackFrame(JdtEvaluationProvider.java:231)
  at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.ensureDebugTarget(JdtEvaluationProvider.java:311)
  at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.evaluate(JdtEvaluationProvider.java:111)
  at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.evaluate(JdtEvaluationProvider.java:105)
  at com.microsoft.java.debug.core.adapter.handler.EvaluateRequestHandler.lambda$handle$0(EvaluateRequestHandler.java:76)
  ... 6 more

Expect: can evaluate variables successfully.

Improve UI

So I saw an earlier issue about compilation mode and coloring..

Would it be alright if I worked on improving the UI aesthetics a bit when running tests, possibly by switching from compilation mode to some custom mode? I think this would especially be good if, in some day in the future, you wanted to find the source of failing tests or some such.

Thanks :)

Consider using transient maps over hydras for controlling debugger state

Hello!

One minor complaint I have about dap-mode is that the hydra that controls the debugger state (e.g. lets you do next, in, disconnect etc) is open even when you switch to a buffer in another window. I'm wondering if there's some configuration you can do to hydras or if transient or local keymaps could be used.

I wonder if perhaps magit's transient could be used for this.

Thank you! :)

Wrong type argument

Okeydokes, so I switched over dash and all the things that depend on it to use the most current git repos instead. Now when I run dap-java-debug-test-class, I run into the following error:

Debugger entered--Lisp error: (wrong-type-argument stringp (:type "java" :request "attach" :hostName "localhost" :port 33000 :wait-for-port t :program-to-start "java -Xdebug

and so on, followed by

dap-start-debugging((:type "java" :request "attach" :hostName "localhost" :port 33000 :wait-for-port t 

etc.

Thanks for the help last time, hopefully I'll be able to try out your debugger interface soon

dap-debug lsp-go fails with: Searching for program: No such file or directory, node

First of all, thank you very much for this package.

This is the current configuration I have (it works perfectly fine with python for example):

(defun ig/go-mode-hook ()
      (add-to-list 'company-backends 'company-go)
      (setq tab-width 4)
      )
(use-package go-mode
  :ensure t
  :hook (
         (go-mode . ig/go-mode-hook)
         (go-mode . flycheck-mode))

  :config
  (require 'dap-go)
  (dap-go-setup)
  (setq gofmt-command "goimports")
  )
(use-package lsp-mode
      :hook (
             (python-mode . lsp)
             (go-mode . lsp))
      :config
      (require 'lsp-clients)
      ;; Disable flymake
      (setq lsp-prefer-flymake nil)
      (lsp-register-client
       (make-lsp-client :new-connection (lsp-stdio-connection "gopls")
                        :major-modes '(go-mode)
                        :server-id 'gopls)))

Trying to start a debug session (e.g. add a breakpoint then run dap-debug) gives the message:
Searching for program: No such file or directory, node

Maybe it is not a real issue of dap-mode but to be honest I can not figure out where the issue comes from.

Issues when running emacs as a daemon.

When I am running emacs in daemon mode, I have two issues:

  1. Breakpoints are not visible until they are activated. I don't see the yellowish / wihteish dot when adding a breakpoint, but the breakpoint does seem to work.

  2. Debugging test methods/classes doesn't work. The test is run, but debugging doesn't work. Similar to #37.

Can't get dap-python to work

How do I get dap-mode to work for python? Once I launch dap-debug it hangs at the compilation buffer I see this warning Invalid function: with-connection-local-variables. I'm using Emacs 27 compiled from source and spacemacs dev branch. lsp was added through spacemacs layers, and I have ptvsd installed.

gdb: breakpoints with dynamic library

With dynamic library saying, I have:

library.cc -> library.so
main.cc -> main [which use the library.so]

If I dap-add-breakpoint on library.cc:58 on gdb main, the gdb will prompt:

No source file named library.cc
Make breakpoint pending on future shared library load? (y or [n]) 

But dap will ignore with no breakpoint set. So I cannot step into program. Is there any template argument I can configure with?

Usually when I do gdb, I will enter start command to start the program so that the .so file is loaded. I can break on library.cc:58.
Or we can answer yes to: "Make breakpoint pending on future shared library load? (y or [n]) "

Setting constant symbol

Hey, I've had a little issue with dap-mode: any attempt to run/debug a test or class simply does not work/

With debug-on-error set to t, I can see that the stacktrace is:

Debugger entered--Lisp error: (setting-constant :skip-debug-session)
  dap-start-debugging((:type "java" :request "attach" :hostName "localhost" :port 33000 :wait-for-port t 
...

I've narrowed down the error to the -let* binding in the method dap-start-debugging. My version of dash is 2.14.1.

Thank you!

dap-debug → Attach → open-network-stream wrong-type-argument stringp nil

Heya,

sorry to bother you again, but dap-java has stopped working for me and I cannot figure out why.
In a working lsp-java project where dap-java has worked pretty well the last month, I now get this whenever I do M-x dap-debug → Attach → 5005:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  make-network-process(:name "localhost(5005)" :buffer nil :host "localhost" :service nil :nowait nil :tls-parameters nil)
  open-network-stream("localhost(5005)" nil "localhost" nil :type plain)
  dap--create-session((:type "java" :request "attach" :hostName "localhost" :port 5005 :host "localhost" :name "localhost(5005)" :debugServer nil :__sessionId "1547123273.6672068"))
  dap-start-debugging((:type "java" :request "attach" :hostName "localhost" :port 5005 :host "localhost" :name "localhost(5005)" :debugServer nil :__sessionId "1547123273.6672068"))
  dap-debug((:type "java" :request "attach" :hostName "localhost" :port 5005 :host "localhost" :name "localhost(5005)" :debugServer nil :__sessionId "1547123273.6672068"))

Output in *Messages*:

10-Jan-2019 13:38:25 >> workspace/executeCommand vscode.java.startDebugSession
Error from the Language Server: No delegateCommandHandler for vscode.java.startDebugSession (Method not Found)
open-network-stream: Wrong type argument: stringp, nil

I've updated the language server with M-x lsp-java-update-server, but vscode.java.startDebugSession is still apparently not available.

Versions:

GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2018-12-14
lsp-java-20181221.1616
lsp-mode-20190105.2044
lsp-ui-20190109.1959
dap-mode-20190109.1841

dap-java should provide way to pass extra args to jvm

dap-java should either honour lsp-java-vmargs or provide a way to pass jvm arguments
This feature is primarily needed for tools such as jacoco or jmockit

Ideally maven's argLine tags or gradle's jvmArgs should be respected in dap-java-run-* functions
Though it seems such feature cannot be directly implemented in dap but rather belongs to lsp-java or LSP server itself. I might be wrong

dap-python configured args are not passed to the target program

(compile (format "%s -m ptvsd --wait --host %s --port %s %s" python-executable host debug-port buffer-file-name))

Maybe we can add another argument to the python command and passing the fetched args from the configuration.

(compile (format "%s -m ptvsd --wait --host %s --port %s %s %s" python-executable host debug-port buffer-file-name (plist-get conf :args))

/Tai

dap-debug-edit-template seems broken with python

With dap-debug-edit-template, my understanding is that we adapt the configuration, evaluate the new value then the debug session will be started.
But since all the new value is modified in a new opened buffer, buffer-file-name seems no longer valid?

Or we have another proper WoW for dap-debug-edit-template?
/Tai

Strange ui behaviour

dap-mode seems really awesome, but I'm getting some strange behavior with the ui when using it with dap-gdb-lldb. I navigate to a buffer with a breakpoint and run dap-debug and select the LLDB run configuration and my executable. The debugger connects, but then an empty buffer with the name ?? pops up in place of the .cpp file I was viewing. I can manually call dap-ui-repl to get the debugger repl, but when I step through the code (i.e. using n), the repl buffer switches to the file being debugged with the arrow pointing to the current line. This is quite annoying because then I have to switch back to the repl buffer to continue stepping.

Suggestions or potential ideas - Junit test runner integration

I noticed that you've been experimenting with Eclipse che per look at the source code.
Based on the work that you've got so far and the lsp-java code, I've integrated junit testing with LSP in my current workflow (tested only on simple projects, not perfect but I'm happy so far):

  • I'm leveraging semantic to get the current package or method name via semantic-brute-find-tag-by-class and semantic-brute-find-tag-by-position per code below.
  • I'm using a custom variable junit-platform-jar-file serving the same purposes as what you've got in dap-java-test-runner.
  • Most of the time, I either want to run all the tests (Maven or gradle) or specific ones (if possible without invoking a build tool). In my case, having a tests explorer is not a critical feature (vscode-java-test).

I'm posting what I use so far, in case it might help you with your design and overall ideas.
Thanks for your efforts and good work on Emacs packages, I'm experimenting once in a while with dap-mode and it looks very promising.

Try running the test under the cursor

This tries running the enclosing test closer to the point, it falls back to running the entire test class.

(defun ers/lsp-run-test-method ()
  (interactive)
  (let* ((cls-name     (file-name-sans-extension (file-name-nondirectory buffer-file-name)))
         (pkg-name     (caar (semantic-brute-find-tag-by-class 'package (current-buffer))))
         (fqcn         (concat pkg-name "." cls-name))
         (method-name  (caar
                        (cl-remove-if-not
                         (lambda (m)
                           (and (consp (last m))
                                (overlayp (first (last m)))
                                (>= (point) (overlay-start (first (last m))))
                                (<= (point) (overlay-end (first (last m))))))
                         (first
                          (cl-remove-if-not
                           (lambda (elt)
                             (and (consp elt)
                                  (> (length elt) 1)))
                           (first
                            (cl-remove-if-not
                             'consp
                             (semantic-brute-find-tag-by-position (point) (current-buffer))))))))))
    (if method-name
        (compile
         (concat "java -jar "
                 junit-platform-jar-file
                 " --class-path "
                 (mapconcat 'identity (cadr (lsp-send-execute-command "vscode.java.resolveClasspath" (list fqcn nil ))) ":")
                 " -f "
                 (buffer-file-name)
                 " -m "
                 (concat fqcn "#" method-name)
                 " --details verbose")
         t)
      (ers/lsp-test-run-test-class))))

Run a test class

(defun ers/lsp-run-test-class ()
  (interactive)
  (let* ((cls-name (file-name-sans-extension (file-name-nondirectory buffer-file-name)))
         (pkg-name (caar (semantic-brute-find-tag-by-class 'package (current-buffer))))
         (fqcn     (concat pkg-name "." cls-name)))
    (compile
     (concat "java -jar " junit-platform-jar-file
             " --class-path "
             (mapconcat 'identity (cadr (lsp-send-execute-command "vscode.java.resolveClasspath" (list fqcn nil ))) ":")
             " -f " (buffer-file-name)
             " --include-package " pkg-name " -c " fqcn " --details verbose")
     t)))

Breakpoints not active unless toggled on subsequent requests

As promised the first issue I encountered integrating php support:

Using dap-php to debug a http-request via xdebug, added breakpoints are not honored on subsequent requests, unless I toggle/reset one of them -- if I do that, all active breakpoints work.

Trouble setting up PHP debugging

Hi.

I'm trying to setup PHP debugging. I've installed the felixbecker/vscode-php-debug extension and it seems to be working fine (runs on command line with no errors).

When I run M-x dap-debug on emacs i get:

Symbol’s function definition is void: first

Is there something I'm doing wrong or missing some step? How can I help debug this isse?

Here's a stack trace of the execution:

Debugger entered--Lisp error: (void-function first)
  first(("Php Run Configuration" :type "node" :cwd nil :request "launch" :name "Php Debug" :args ("--server=4711") :sourceMaps t))
  #[257 "\300�!�B\207" [first] 3 "\n\n(fn IT)"](("Php Run Configuration" :type "node" :cwd nil :request "launch" :name "Php Debug" :args ("--server=4711") :sourceMaps t))
  mapcar(#[257 "\300�!�B\207" [first] 3 "\n\n(fn IT)"] (("Php Run Configuration" :type "node" :cwd nil :request "launch" :name "Php Debug" :args ("--server=4711") :sourceMaps t)))
  dap--completing-read("Select configuration template: " (("Php Run Configuration" :type "node" :cwd nil :request "launch" :name "Php Debug" :args ("--server=4711") :sourceMaps t)) first nil t)
  byte-code("\301\302\303�\304\305\306%A!C\207" [dap--debug-template-configurations copy-tree dap--completing-read "Select configuration template: " first nil t] 7)
  #<subr call-interactively>(dap-debug record nil)
  apply(#<subr call-interactively> dap-debug (record nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> dap-debug record nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (dap-debug record nil))
  call-interactively(dap-debug record nil)
  #[1025 "\306�\211?\205�

Symbol’s function definition is void: first

When I tried to use dap-lldb for debugging c file, after running M-x dap-debug I got Symbol’s function definition is void: first.

lsp-mode and dap-mode are installed as:

(use-package lsp-mode
  :commands lsp
  :init
  (setq lsp-prefer-flymake nil
	lsp-session-file (expand-file-name ".lsp-session-v1" my:cache-dir)))

(use-package lsp-ui
  :commands lsp-ui-mode
  :init
  (add-hook 'lsp-mode-hook #'lsp-ui-mode))

(use-package dap-mode
  :config
  (dap-mode 1)
  (dap-ui-mode 1))

(require 'dap-lldb)
(require 'dap-python)

If debug-on-error is turned on, the debugger shows that

Debugger entered--Lisp error: (void-function first)
  first(("LLDB Run Configuration" :type "lldb" :cwd nil :request "launch" :program nil :name "LLDB::Run"))
  #f(compiled-function (it) #<bytecode 0x16c48b5>)(("LLDB Run Configuration" :type "lldb" :cwd nil :request "launch" :program nil :name "LLDB::Run"))
  mapcar(#f(compiled-function (it) #<bytecode 0x16c48b5>) (("LLDB Run Configuration" :type "lldb" :cwd nil :request "launch" :program nil :name "LLDB::Run")))
  dap--completing-read("Select configuration template: " (("LLDB Run Configuration" :type "lldb" :cwd nil :request "launch" :program nil :name "LLDB::Run")) first nil t)
  byte-code("\301\302\303\010\304\305\306%A!C\207" [dap--debug-template-configurations copy-tree dap--completing-read "Select configuration template: " first nil t] 7)
  call-interactively(dap-debug record nil)
  command-execute(dap-debug record)
  execute-extended-command(nil "dap-debug" #("dap\ndap-debug-edit-template\ndap-mode\ndap-debug\ncalendar\nada-mode\ndap-eval\ndap-next\nholidays\ndap-hydra" 3 4 (read-only nil) 4 6 (face (ivy-current-match ivy-minibuffer-match-face-1) mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 6 27 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) face ivy-current-match read-only nil) 27 28 (read-only nil) 28 30 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 30 36 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 36 37 (read-only nil) 37 39 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 39 46 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 46 47 (read-only nil) 47 52 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 52 54 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 54 55 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 55 56 (read-only nil) 56 57 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 57 59 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 59 64 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 64 65 (read-only nil) 65 67 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 67 73 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 73 74 (read-only nil) 74 76 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 76 82 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 82 83 (read-only nil) 83 87 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 87 89 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 89 91 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 91 92 (read-only nil) 92 94 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 94 101 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil)))
  funcall-interactively(execute-extended-command nil "dap-debug" #("dap\ndap-debug-edit-template\ndap-mode\ndap-debug\ncalendar\nada-mode\ndap-eval\ndap-next\nholidays\ndap-hydra" 3 4 (read-only nil) 4 6 (face (ivy-current-match ivy-minibuffer-match-face-1) mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 6 27 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) face ivy-current-match read-only nil) 27 28 (read-only nil) 28 30 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 30 36 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 36 37 (read-only nil) 37 39 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 39 46 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 46 47 (read-only nil) 47 52 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 52 54 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 54 55 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 55 56 (read-only nil) 56 57 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 57 59 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 59 64 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 64 65 (read-only nil) 65 67 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 67 73 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 73 74 (read-only nil) 74 76 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 76 82 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 82 83 (read-only nil) 83 87 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 87 89 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 89 91 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 91 92 (read-only nil) 92 94 (face ivy-minibuffer-match-face-1 mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil) 94 101 (mouse-face ivy-minibuffer-match-highlight help-echo (format (if tooltip-mode "mouse-1: %s\nmouse-3: %s" "mouse-1: %s   mouse-3: %s") ivy-mouse-1-tooltip ivy-mouse-3-tooltip) read-only nil)))
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Maybe -first from dash.el should be used instead? Or maybe a dependent package is missing?

Please let me know if I can help.

open-network-stream: Wrong type argument: stringp, nil

This looks like a cool extension for Emacs, but I cannot get it to work with remote debugging.

I've added this to my .emacs:

(use-package dap-java
  :config
  (dap-register-debug-provider
   "java"
   (lambda (conf)
     (plist-put conf :debugPort 5005)
     (plist-put conf :host "localhost")
     conf))
  (dap-register-debug-template "Example Configuration"
                             (list :type "java"
                                   :request "launch"
                                   :args ""
                                   :name "Run Configuration"))
  )

But upon running dap-debug, selecting this or any other debug template, I get:

open-network-stream: Wrong type argument: stringp, nil

Do you have any idea why?

My versions are:

dap-mode-20180909.1854
lsp-java-20180906.637
GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-04-25

Cheers!

Lacking feature to send strings from stdin interactively?

Could you debug code which requests input from stdin such as below?

int main() {
     scanf("%d", &t); // <- Input is expected from stdin.
...
    // Conditional operation which depends input from stdin.
   // ...
}

I've investigated on Linux.
I could track down, that when M-x dap-debug is done, the following sequence has arisen.

  1. https://github.com/llvm-mirror/lldb/tree/master/tools/lldb-vscode is started.
  2. lldb-vscode started lldb-server gdbserver --fd=6 --native-regs --setsid.

It seems lldb-vscode and lldb-server is communicating with unnamed socket, but lldb-vscode has no option to send stdin to lldb-server. I get stucked here...

start debug session in dap-hydra

Currently, I used to open dap-hydra to add break points in source files, but I'm forced to close dap-hydra to issue dap-debug command. Maybe the better way is to add a key in dap-hydra to start debug.

dap-gdb-lldb-debug-program is not correct.

I am using https://github.com/WebFreak001/code-debug for debugging c++.

  • ext install webfreak.debug in vscode
    The gdb.js is located in /home/jimmy/.vscode-oss/extensions/webfreak.debug-0.23.1/out/src/gdb.js

  • mkdir -v ~/.extensions && ln -s /home/jimmy/.vscode-oss/extensions/webfreak.debug-0.23.1 ~/.extensions/webfreak.debug

(defcustom dap-gdb-lldb-debug-program `("node" ,(expand-file-name (f-join dap-gdb-lldb-path "extension/out/src/gdb.js")))

I think it is supposed to be "out/src/gdb.js", instead of "extension/out/src/gdb.js", isn't it?

args-out-of-range

System Info 💻

  • OS: darwin
  • Emacs: 26.1
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 2c28c7d21)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(sql helm osx command-log
     (ranger :variables ranger-show-preview t)
     auto-completion
     (better-defaults :variables better-defaults-move-to-end-of-code-first nil better-defaults-move-to-beginning-of-code-first t)
     (python :variables python-enable-yapf-format-on-save t)
     html web-beautify ...)
  • System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS

Backtrace

Debugger entered--Lisp error: (args-out-of-range "{\"event\":\"output\",\"body\":{\"category\":\"stdout\",\"output\":\"2019-01-13 00:16:36  [ main ] - [ INFO com.inspur.common.utils.PropertiesBuilder.getConfig(32)]  从jar内加载:kafka-producer.properties\\n\",\"type\":\"output\"},\"seq\":9,\"type\":\"event\"}" 0 238)
  substring("{\"event\":\"output\",\"body\":{\"category\":\"stdout\",\"output\":\"2019-01-13 00:16:36  [ main ] - [ INFO com.inspur.common.utils.PropertiesBuilder.getConfig(32)]  从jar内加载:kafka-producer.properties\\n\",\"type\":\"output\"},\"seq\":9,\"type\":\"event\"}" 0 238)
  (let* ((total-body-length (progn (or (and (memq (type-of p) cl-struct-dap--parser-tags) t) (signal 'wrong-type-argument (list 'dap--parser p))) (aref p 6))) (received-body-length (progn (or (and (memq (type-of p) cl-struct-dap--parser-tags) t) (signal 'wrong-type-argument (list 'dap--parser p))) (aref p 7))) (chunk-length (string-bytes chunk)) (left-to-receive (- total-body-length received-body-length)) (this-body (substring chunk 0 (min left-to-receive chunk-length))) (leftovers (substring chunk (string-bytes this-body)))) (store-substring (progn (or (and (memq (type-of p) cl-struct-dap--parser-tags) t) (signal 'wrong-type-argument (list 'dap--parser p))) (aref p 4)) received-body-length this-body) 

got follow error msgs when after eval 'dap-breakpoint-add

Debugger entered--Lisp error: (cl-assertion-failed ((lsp--workspace-p lsp--cur-workspace) nil))
  cl--assertion-failed((lsp--workspace-p lsp--cur-workspace))
  dap-breakpoint-add()
  funcall-interactively(dap-breakpoint-add)
  #<subr call-interactively>(dap-breakpoint-add record nil)
  apply(#<subr call-interactively> dap-breakpoint-add (record nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> dap-breakpoint-add record nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (dap-breakpoint-add record nil))
  call-interactively(dap-breakpoint-add record nil)
  command-execute(dap-breakpoint-add record)
  #f(compiled-function (cmd) #<bytecode 0x4414d6f1>)("dap-breakpoint-add")

dap-ui-debug-window: Symbol’s function definition is void: debug-window-mode

Have a remote debug session against Tomcat going, dap stops at my break point and I can see the locals with dap-ui-locals. So far so good.

However, I'd like to see the threads so that I can step back in the call stack, I therefore tried out the different dap-ui-* methods in the hope that one of these would give me the thread view I'm familiar with from other IDEs, however:

M-x dap-ui-debug-window

yielded only:

dap-ui-debug-window: Symbol’s function definition is void: debug-window-mode

On a related question: I would expect dap-mode to open default/configure dap-ui windows either when you first call dap-debug or at the latest, when the code hits a breakpoint. Right now, I'm fumbling a bit in the dark.

Versions:

GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-04-25
dap-mode-20180911.1835 
lsp-mode-20180911.1829 
lsp-ui-20180910.328

No delegateCommandHandler for vscode.java.resolveClasspath

When running lsp-java with dap-mode, and trying to run dap-java-run-test-class or dap-java-run-test-method I get the error:

No delegateCommandHandler for vscode.java.resolveClasspath

Anything I'm supposed to setup to get this to work?

My tests are JUnit 4.

Company Mode not enabled in dap-ui-repl by default

First, let me say thanks so much for this package and for the awesome work you do for this and lsp-mode!

I am noticing that completions don't work when I first start the repl. I am using spacemacs if that matters. Whenever I open the dap-ui-repl, I don't get completions until I enable company-mode explicitly. Should it be enabled by default? Is there a hook I should add the company-mode call to for the dap-ui-repl?

:cwd does not work for dap-python

The compile command is currently being executed inside the dap-python--populate-start-file-args directly, which does not process the :cwd. We should only build up the program-to-start and let the dap-debug process it as usual.

dap-python setup not working

Run M-x dap-debug against a python file raises:

python -m ptvsd --port 32000 /home/rws/hack/test.py
usage: python -m ptvsd [-h] [--nodebug] [--client] --host HOST --port PORT [--multiprocess] [-m MODULE] [-c CODE] [--pid PID]
                       [--single-session] [--wait] [-V]
                       [filename]
python -m ptvsd: error: argument --host is required

while host should have been specified at https://github.com/yyoncho/dap-mode/blob/2cf98d4a2268fa4ca92a35723ed3883eff734d1f/dap-python.el#L52

I setup dap following the official README:

(require 'dap-mode)
(require 'dap-ui)
(dap-mode 1)
(dap-ui-mode 1)
(require 'dap-python)

(emacs-version) => "GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
of 2018-10-22"

not able to debug java project

hey guys,

i'm very impressed what's possible with lsp and dap-mode. Looking forward to use is, i tried to configure everything and when trying to debug my maven/java project, i only get this

lsp-send-execute-command: Capability not supported by the language server: "executeCommandProvider"

No matter if i use "dap-debug" oder "dap-java-debug" the result is the same. Am I using the wrong version of the language server? (used the linux-snippets in the README)

thank you for your help

Unable to run `dap-java-debug-test-*` functions

Hey,

I've recently updated dap-mode and all the dap-java-debug-* methods have stopped working.

Here's a stacktrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\'[[:ascii:]]+\\'" nil)
  puny-encode-domain(nil)
  open-network-stream(nil nil nil nil :type plain)
  (if dap-server-path (make-process :name session-name :connection-type 'pipe :coding 'no-conversion :command dap-server-path :stderr (generate-new-buffer-name (concat "*" session-name " stderr*")) :noquery t) (open-network-stream session-name nil host port :type 'plain))
  (let* ((host (plist-get launch-args :host)) (dap-server-path (plist-get launch-args :dap-server-path)) (session-name (plist-get launch-args :name)) (port (plist-get launch-args :debugServer)) (proc (if dap-server-path (make-process :name session-name :connection-type 'pipe :coding 'no-conversion :command dap-server-path :stderr (generate-new-buffer-name (concat "*" session-name " stderr*")) :noquery t) (open-network-stream session-name nil host port :type 'plain))) (debug-session (make-dap--debug-session :launch-args launch-args :proc proc :name (plist-get launch-args :name) :workspace lsp--cur-workspace))) (set-process-sentinel proc (function (lambda (_process exit-str) (message "Debug session process exited with status: %s" exit-str) (dap--mark-session-as-terminated debug-session)))) (set-process-filter proc (dap--create-filter-function debug-session)) debug-session)
  dap--create-session((:type "java" :request "attach" :hostName "localhost" :port 33001 :wait-for-port t :program-to-start "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=33001 -jar /my-personal/junit-runner/JUnitRunner.jar -cp $JUNIT_CLASS_PATH -m com.testclass#testmethod" :environment-variables (("JUNIT_CLASS_PATH" . "really long classpath")) :cwd "/cwd"))
  dap-start-debugging((:type "java" :request "attach" :hostName "localhost" :port 33001 :wait-for-port t :program-to-start "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=33001 -jar /my-personal/junit-runner/JUnitRunner.jar -cp $JUNIT_CLASS_PATH -m com.testclass#testmethod" :environment-variables (("JUNIT_CLASS_PATH" . "really long classpath")) :cwd "/cwd"))
  dap-debug((:type "java" :request "attach" :hostName "localhost" :port 33001 :wait-for-port t :program-to-start "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=33001 -jar /my-personal/junit-runner/JUnitRunner.jar -cp $JUNIT_CLASS_PATH -m com.testclass#testmethod" :environment-variables (("JUNIT_CLASS_PATH" . "really long classpath")) :cwd "/cwd"))
  dap-java-debug-test-method(33001)
  funcall-interactively(dap-java-debug-test-method 33001)
  call-interactively(dap-java-debug-test-method record nil)
  command-execute(dap-java-debug-test-method record)
  execute-extended-command(nil "dap-java-debug-test-method" nil)
  funcall-interactively(execute-extended-command nil "dap-java-debug-test-method" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I made sure to update dash to the latest version as well so it doesn't seem to be caused by that.

Is it because dap-java-debug-test-method never calls dap-java--populate-default-args?

Best,
SerialVelocity

Auto expand variables in dap-ui-locals

One thing I liked about the old JDIbug, was that it auto expanded the locals view and it would significantly improve the user experience with dap-mode IMHO.

I wish I could have dap-mode:

  • expand all objects in the dap-ui-locals view
  • except objects where the toString representation listed in the node (header) is normally sufficient, like Strings, i normally only want to see the string "foo" in the collapsed node header, I don't need to see the internal data structure of java.lang.String.

Problems running tests using dap-java

Hey,

Great work on dap-mode so far! I thought I'd leave a message with all the issues I encountered though:

  • When running dap-java-run-test-class, it fails with:

    compilation-start: Wrong type argument: stringp, :program-to-start
    

    Fixed by replacing (first ...) with (plist-get ... :program-to-start) in dap-java- run-test-class (to make it mirror dap-java-run-test-method).

  • When running dap-java-run-test-method, it fails with:

    org.junit.platform.commons.util.PreconditionViolationException: No arguments were supplied to the ConsoleLauncher
    

    This is because the class path isn't being passed to the compile command.
    Fixed with a simple (mapc (-lambda ((env . value)) (setenv env value)) (plist-get params :environment-variables) stolen from your debug codepath.

  • The working directory for running tests is wrong. It looks like the working directory used for running the test is where the .java file is located. It should be the project root (not necessarily the workspace root).

  • The junit runner outputs colours. It would be nice if you used a buffer which supports them. Maybe this is just me needing to use something like ansi-color? (would be nice to have support built-in though)

Best,
Ben

P.S. I love that the output is live. I really hated that both emacs and eclipse hung when using eclim. ❤️

How to use the `:program` option when registering a debug provider?

I'm trying to make dap-mode talk to vsdbg, Microsoft's debugger for Windows.

vsdbg.exe --help
VsDbg is a cross-platform Microsoft debugger.

Options:
--attach <process-id>                 Attach the debugger to the specified process id.
--attach --name <process-name>        Attach the debugger to the specified process name.
--interpreter=mi                      Puts vsdbg into MI mode. In this mode, commands and
    output are structured to allow vsdbg to be controlled by the Visual Studio debugger UI
--interpreter=vscode                  Puts vsdbg into VS Code Debugger mode. In this mode,
    commands and output allow vsdbg to be controlled by the VS Code Debugger UI
--pauseEngineForDebugger              Wait for a debugger to attach during startup
--engineLogging[=<path to log file>]    Enable logging to VsDbg-UI or file for the engine.
    Only supported by the VsCode interpreter.
--connection=<id>                     Connect to the specified VsDbg-UI instance.

I think starting it with --interpreter=vscode puts it into DAP mode.

I have this:

  (dap-register-debug-provider
   "cpp"
   (lambda (conf)
     (plist-put conf :program "C:/Users/parbo/Downloads/Microsoft.VisualStudio.VsDbg/debugAdapters/vsdbg/bin/vsdbg.exe --interpreter=vscode")
     conf))

and

  (dap-register-debug-template "C++ Run Configuration"
                               (list :type "cpp"
                                     :request "launch"
                                     :args ""
                                     :name "Run Configuration"))

But it doesn't seem like vsdbg gets launched at all when I do dap-debug. I get this stack-trace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\'[[:ascii:]]+\\'" nil)
  puny-encode-domain(nil)
  open-network-stream("Run Configuration" nil nil nil :type plain)
  dap--create-session((:type "cpp" :request "launch" :args "" :name "Run Configuration" :program "C:/Users/parbo/Downloads/Microsoft.VisualStudio.VsDbg/debugAdapters/vsdbg/bin/vsdbg.exe --interpreter=vscode"))
  dap-start-debugging((:type "cpp" :request "launch" :args "" :name "Run Configuration" :program "C:/Users/parbo/Downloads/Microsoft.VisualStudio.VsDbg/debugAdapters/vsdbg/bin/vsdbg.exe --interpreter=vscode"))
  dap-debug((:type "cpp" :request "launch" :args "" :name "Run Configuration" :program "C:/Users/parbo/Downloads/Microsoft.VisualStudio.VsDbg/debugAdapters/vsdbg/bin/vsdbg.exe --interpreter=vscode"))
  funcall-interactively(dap-debug (:type "cpp" :request "launch" :args "" :name "Run Configuration" :program "C:/Users/parbo/Downloads/Microsoft.VisualStudio.VsDbg/debugAdapters/vsdbg/bin/vsdbg.exe --interpreter=vscode"))
  call-interactively(dap-debug record nil)
  command-execute(dap-debug record)

I must be doing something wrong..

dap-php-setup doesn't work

I tried running it, in the Messages buffer I've got the following:

dap-php: felixfbecker.php-debug debug extension are not set. You can download it with M-x dap-php-setup
Contacting host: marketplace.visualstudio.com:443
uncompressing publicsuffix.txt.gz...done
Wrote /tmp/extcqZSxg.zip
helm-M-x: Wrong type argument: stringp, nil

dap-java-run-test-method, dap-java-run-test-class don't seem to identify maven failsafe tests

Hi @yyoncho, lsp-java and dap-mode are the best.

On regular surefire tests (test class ending in Test.java), the dap-java test methods seem to find and run the test methods OK.

On failsafe integration tests (test class ending in IT.java), it doesn't find any tests:

Test run finished after 45 ms
[ 2 containers found ]
[ 0 containers skipped ]
[ 2 containers started ]
[ 0 containers aborted ]
[ 2 containers successful ]
[ 0 containers failed ]
[ 0 tests found ]
[ 0 tests skipped ]
[ 0 tests started ]
[ 0 tests aborted ]
[ 0 tests successful ]
[ 0 tests failed ]

Even though the integration tests have the same @test annotations as the regular tests.

The IT tests do have @RunWith(SpringJUnit4ClassRunner.class) and @ContextConfiguration annotations though.

Am I missing something?

How to bind dap-delete-all-sessions and dap-java-debug together?

I use vscode at the mean time and fond of pressing f5 to run and restart java server. Moving to emacs for a while and trying to configure lsp-java and dap mode so i can save some times on running my code. I have tried the following code to make multiple command into a single command and then bind it to f5 using :bind provided by use-package but when i tested it, i got some error: Wrong type argument: stringp, nil

Please help me fix this issue.

(use-package dap-mode
  :ensure t
  :bind
  (
   ("<f4>" . 'dap-java-run)
  )
  :after lsp-mode
  :config
  (dap-mode t)
  (dap-ui-mode t)
  )



(defun dap-java-run ()
  (interactive)
  (dap-delete-all-sessions)
  (dap-java-debug))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.