Replies: 1 comment 1 reply
-
|
@svaante Have you considered doing it the way |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Intro
I want some feedback on an
dapeissue that I have been think about for a while and something I want to get right, especially if the solution will break user defined configurations (calling itconfigswas an mistake,templateswould have been better).Let me just preface this to get your mind in the right place.
dapeis to be as close to the emacs way of doing things.dapeconfiguration format is anplistnot an json object.dapeconfiguration from an "launch.json" (necessary evil I think).Problems
dapeto remove or ignore an property in an configuration.Improve usage ergonomics
If we use the following configuration as an example to illustrate the issue:
The user want to debug using the
gdbconfig but does not want the environment variableDEBUGto be set.There is two ways to work around this, both being painful:
dape-configswhere:env (:DEBUG 1)is removeddapecommand withlaunch :request "launch" :program "a.out" ...with add all properties from thegdbconfig without:env (:DEBUG 1)Improve discoverability in batteries included configs
Let's reuse the same configuration.
If I where to add this configuration as an batteries included config it would look something like this.
Notice the missing
:envproperty. Even though I know that:envexist I can't document the fact in the config without using some strange default value for:envto make it show up indapecompletions and the hint section.The user has to lookup the gdb manual to figure out that's the way to set environment variables.
Suggested solutions
Here follows some possible solutions. Split into the categories:
dapecommand read functionalityIntroduce an new special config value
One way would be to add an "null" or an "ignore" symbol.
dapecommand overwrite the config value withgdb :env some-new-symbol:env some-new-symbolcan be added (the user still has to know that the value is anplist), which makes it show up in the hint buffer and as an completion.JSON "null"
Add an symbol/keyword whatever which allows the user to set a property to json "null" to send
nullas part of thelaunch/attachrequest.Ramblings on which symbol to use
In lisp `nil` is `false` and `t` is `true`. But when parsing json "null" and "false" is valid values but there is no obvious to translate into in lisp.In
json-parse-bufferthe default value is:null, injsonrpcit's'niland "false" is:json-false.Not a big fan of any of them as it's not really line up with point (2.) under Solutions but that does not rule out the solution.
One benefit of having an null value is to allow for
dapeto actually send "null" if an adapter requires null for some reason.Ignore symbol
Introduce an symbol, let's call it
ignorewhich just removes the property at before sending it off to adapter.And using as follows with the
dapecommand:gdb :env ignoreExtremely unobtrusive option.
Add an special value construct with docs
This will only solve the problem under "Improve discoverability in batteries included configurations". But can be combined with the other options to solve both.
Something like the following:
The
:docinformation can then be displayed in the hint section of theminibuffer.Rework
daperead configTo allow for removal of properties, which basically means that that all properties needs to be presented in some way to be able to remove them.
Pop up buffer
dapecommand complete from the available configs nothing moredape-editwhich lets you edit the configurationUsing
edit-macroas inspiration and with combination of "Add an special value construct with docs" can show docs as well.Transient
Maybe transient could be used in some way am not that familiar with
transient.Define an specialized parser for each config
See #44 (comment)
Beta Was this translation helpful? Give feedback.
All reactions