svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
448 stars 25 forks source link

Suggestion: Configure in runtime instead of in init.el #88

Closed konrad1977 closed 1 month ago

konrad1977 commented 5 months ago

Instead of having the simulator-id and andapp-buindle-idin my init.el Would it be possible to something like this instead?

(require 'dape)
(dape-launch-debug-session 
    :simulator-id "<GUID>"
    :app-bundle-id "com.mycompany.app")

So I can start it from own code and dynamically inject data to it?

svaante commented 5 months ago

Hey, could you explain to me further what your use case is?

konrad1977 commented 5 months ago
  1. It's now limited to one simulator and one app bundle id.
  2. I detect this in runtime when I parse the project (xcworkspace/xcproj).

This is my own package: iOS-simulator.el I will get both the active sim-id and the bundle id I try to launch, would be nice to launch it with Dape.

svaante commented 5 months ago

Does not the fn property work in dape-configs for your usecase?

Functions applied on config before starting debugging session. Each function is called with one argument CONFIG and should return an PLIST of the format specified in dape-configs.

konrad1977 commented 5 months ago

Maybe it does, but I am still new to Emacs and E-lisp. I'll investigate your suggestion a bit further.

konrad1977 commented 4 months ago

I have another question. I am also using Corfu, but how do you tell it to use swift in the completion in region in Dape?

svaante commented 4 months ago

Sorry for the late reply, if you have corfu enabled with (global-corfu-mode) and using codelldb typing hel<M-TAB> should bring up an corfu window with "help" as an candidate.

svaante commented 3 months ago

Dape did wrongfully throw away completion candidates when repl buffer contained an whitespace.

    int var1, var2;
=>

In side of *dape-repl*:

> p var<M-TAB>

Will show the compleation candidates var1 and var2

This is fixed as of dbe9f13

konrad1977 commented 1 month ago

I fixed this using my own packages. They will fetch identifier and schemes etc and setup a valid session for debugging. https://github.com/konrad1977/emacs/blob/7139736345438d4d8fcfd2d6da7a106d7896982f/localpackages/xcode-additions.el#L275