svaante / dape

Debug Adapter Protocol for Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Configure in runtime instead of in init.el

konrad1977 opened this issue · comments

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?

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

  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.

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

  • fn: Function or list of functions, takes config and returns config.
    If list functions are applied in order.

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.

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

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?

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.

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

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