emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: dape


From: Mauro Aranda
Subject: Re: [ELPA] New package: dape
Date: Sun, 15 Oct 2023 10:55:37 -0300
User-agent: Mozilla Thunderbird

On 13/10/23 07:35, Daniel Pettersson wrote:

I have some comments about the defcustoms in dape.el:

> (defcustom dape-configs nil
>   "This variable holds the Dape configurations as an alist.
> In this alist, the car element serves as a symbol identifying each
> configuration.  Each configuration, in turn, is a property list (plist)
> where keys can be symbols or keywords.
>
> Symbol Keys (Used by Dape):
> - command: Shell command to initiate the debug adapter.
> - command-args: List of string arguments for the command.
> - command-cwd: Working directory for the command.
> - host: Host of the debug adapter.
> - port: Port of the debug adapter.
> - modes: List of modes where the configuration is active in `dape'
>   completions.
> - compile: Executes a shell command with `dape-compile-fn'.
>
> Debug adapter connection in configuration:
> - If only command is specified (without host and port), Dape
>   will communicate with the debug adapter through stdin/stdout.
> - If both host and port are specified, Dape will connect to the
>   debug adapter.  If `command is specified, Dape will wait until the
>   command is initiated before it connects with host and port.
>
> Keywords in configuration:
>   Keywords are transmitted to the adapter during the initialize and
>   launch/attach requests.  Refer to `json-serialize' for detailed
>   information on how Dape serializes these keyword elements.  Dape
>   uses nil as false.
>
> Functions and symbols in configuration:
>  If a value in a key is a function, the function's return value will
>  replace the key's value before execution.
>  If a value in a key is a symbol, the symbol will recursively resolve
>  at runtime."
>   :type '(alist :key-type (symbol :tag "Name")
>                 :value-type
>                 (plist :options
> (((const :tag "Shell command to start the debug adapter" command) string) > ((const :tag "List of string arguments for command" command-args) (list string)) > ((const :tag "Working directory for command" command-cwd) string) > ((const :tag "Host of debug adapter" host) string) > ((const :tag "Port of debug adapter" port) integer) > ((const :tag "List of modes where config is active in `dape' completions" modes) function) > ((const :tag "Runs shell command with `dape-compile-fn'" compile) function)
>                         (keyword sexp)))))

(keyword sexp) as the last :options looks really weird.  Are you sure
that is the intention?

> (defcustom dape-key-prefix "\C-x\C-a"
>   "Prefix of all dape commands."
>   :type 'key-sequence)

If you're going to depend on 29.1, then perhaps it's better to use 'key,
since a decision was made to obsolete 'key-sequence.  If something
doesn't work with 'key but works with 'key-sequence, then please report
it.

> (defcustom dape-buffers-on-start '(dape-info dape-repl)
>   "Dape buffers to open when debugging starts."
>   :type '(list (const dape-info) (const dape-repl)))

This doesn't allow for any customization at all when using Customize.  I
think you want to use '(repeat function)

> (defcustom dape-main-functions '("main")
> "Functions to set breakpoints at startup if no other breakpoints are set."
>   :type '(list string))

I think you want (repeat string) here.

> (defcustom dape-read-memory-default-count 1024
>   "The default count for `dape-read-memory'."
>   :type '(integer))

Is natnum better suited here?

> (defcustom dape--debug-on
>   '(io info error std-server)
>   "Types of logs should be printed to *dape-debug*."
>   :type '(list (const :tag "dap IO" io)
>                (const :tag "info logging" info)
>                (const :tag "error logging" error)
>                (const :tag "dap tcp server stdout" std-server)))

Similar to dape-buffers-on-start.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]