Commit Graph

54 Commits

Author SHA1 Message Date
Henrik Lissner
c1632fa887 fix(debugger): don't persist breakpoints
Leave it to users to implement this, if they want this, but not only
might it cause confusion, but users may want a clean slate every time
they launch a new debugging session in the same project.

Fix: #8407
2025-06-02 14:19:26 +02:00
Henrik Lissner
4b99e6f156 fix(debugger): wrong-number-of-arguments error
dape-breakpoint-save's sole argument is optional. Calls omitting it
would cause our advise to throw an arity error.

Amend: 52dbde017a
2025-05-14 23:43:58 +02:00
Henrik Lissner
52dbde017a fix(debugger): error if breakpoints dir is missing 2025-05-02 14:56:11 -04:00
Henrik Lissner
b4bd368485 refactor!(debugger): replace realgud with dape
BREAKING CHANGE: Anyone used to realgud will find it missing as of this
commit. It's been replaced with Dape (see
https://github.com/svaante/dape).

This change was made because realgud's implementation was archaic and
over-complicated, dap-mode requires lsp-mode (and has a lot of moving
parts and points of failure), and dape is straight-forward by
comparison; to set up and use. Note that dap-mode and dap-ui is now
deprecated and will be removed in the future, but still remains behind
the +lsp flag for backwards compatibility, at least until v3.

This also adds a '<leader> d' prefix for debugger commands (except for
vanilla users, who already have dape's prefix on 'C-x C-a')
2025-04-23 04:02:06 -04:00
Vikash
d06be8d2ff fix(debugger): dap autoloader for rustic
Fix: #8245
2025-02-21 15:04:07 -05:00
Henrik Lissner
0a715cc3f2 refactor: (if|when)-let -> (if|when)-let*
With the former macros' future in the air (and likely to be targeted in
future, potentially breaking changes), I'll deal with this now than have
it bite me later.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00637.html
2025-01-08 19:33:37 -05:00
Henrik Lissner
448bc5cae2 refactor: use negated flags
Ref: 7a806521a92c
2024-10-20 02:41:50 -04:00
Henrik Lissner
15904349cf refactor!: module API
BREAKING CHANGE: This backports some architectural choices from v3.0.
This changes Doom's module API, renaming some functions and removing
others, in order to facilitate some new features, prepare to move Doom's
modules into separate repos, and make way for two, much larger breaking
commits coming in the next few days.

This commit won't break anything for users unless they're tinkering with
Doom's internals/using its `doom-module-*` API directly. I am avoiding
broader backwards incompatibilities until the 3.0 release.

What's new:

- Negated flags. (modulep! :editor evil -everywhere) will return non-nil
  if :editor evil is active without its +everywhere flag.
- `modulep!` now takes multiple flags to simplify AND checks. E.g.

    (and (modulep! +foo)
         (modulep! +bar)
         (not (modulep! +baz)))

  Can now be expressed with:

    (modulep! +foo +bar -baz)
- Adds pcase matchers for `doom-module-context` and `doom-module`
  structs, making the following destructuring binds possible:

    (pcase-dolist ((doom-module group name flags features)
                   (hash-table-values doom-modules))
      ...)

  This will be used more in v3.0.
- Adds file cookie support to module init.el and config.el files.

Here's a summary of breaking changes made in this commit:

- `doom-module-context` was changed from a vector to a struct (record).
- `doom-modules` is now a table of `doom-module` structs, rather than
  free-form plists.
- The following macros have been renamed:
  - `doom-context-with` -> `with-doom-context`
  - `doom-module-context-with` -> `with-doom-module`
- The followings functions have been replaced/removed:
  - `doom-module-context`+`doom-module-context-get` -> `doom-module`
  - `doom-module-set` -> `doom-module--put`
  - `doom-module-p` -> `doom-module-active-p`
  - `doom-module-context-key` (is now a getter with the same name)
  - `doom-module-put` (removed)
  - `doom-module--context-field` (removed)
- The signatures for these functions have changed:
  - `doom-module-get CATEGORY &optional MODULE PROP` ->
    `doom-module-get (GROUP . MODULE) &optional PROP`
  - `doom-module-locate-path CATEGORY &optional MODULE FILE` ->
    `doom-module-locate-path (GROUP . MODULE) &optional FILE`
  - `doom-module-expand-path CATEGORY MODULE &optional FILE` ->
    `doom-module-expand-path (GROUP . MODULE) &optional FILE`
- Adds the following functions
  - `doom-module-exists-p`
  - `doom-module-key`
  - `doom-module->context`
  - `doom-module<-context`
- Removes the following variables
  - `doom-module--empty-context`

This commit results in a little redundancy, which I will address in
parts 2/3 and/or v3.0.
2024-10-20 02:41:42 -04:00
Blue Willow
e740802035 feat(debugger): add gdscript dap-mode support
This commit adds gdscript support to :tool debugger +lsp, which has been
available in dap-mode since a year ago.
2024-06-03 16:17:16 -04:00
Henrik Lissner
659f7bfc71 refactor!: deprecate IS-* OS constants
BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family
of global constants in favor of a native `featurep` check:

  IS-MAC      ->  (featurep :system 'macos)
  IS-WINDOWS  ->  (featurep :system 'windows)
  IS-LINUX    ->  (featurep :system 'linux)
  IS-BSD      ->  (featurep :system 'bsd)

The constants will stick around until the v3 release so folks can still
use it -- and there are still some modules that use it, but I'll phase
those uses out gradually.

Fix: #7479
2024-02-04 17:54:29 -05:00
Gerry Agbobada
2cd8f85bac fix(debugger): fix dap-ui conditional loading
Probably missed when adding eglot support code in the module
2022-09-07 16:23:24 +02:00
Henrik Lissner
aa54383b5d refactor: deprecate doom-etc-dir for doom-data-dir
doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
2022-08-14 20:43:35 +02:00
Henrik Lissner
ad6a3d0f33 refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
057e6c531c refactor: replace doom-enlist with ensure-list
doom-enlist is now a deprecated alias for ensure-list, which is built
into Emacs 28.1+ and is its drop-in replacement. We've already
backported it for 27.x users in doom-lib (in 4bf4978).

Ref: 4bf49785fd
2022-08-07 19:43:13 +02:00
Henrik Lissner
f76caeece3 bump: :tools debugger lsp
emacs-lsp/dap-mode@67fd9e5d4e -> emacs-lsp/dap-mode@50c2a99059
emacs-lsp/lsp-mode@9faa492692 -> emacs-lsp/lsp-mode@6b6afc00de
joaotavora/eglot@2b87b06d9e -> joaotavora/eglot@e835996e16

Close: #6461
Co-authored-by: MOHENOO <MOHENOO@users.noreply.github.com>
2022-06-17 18:54:27 +02:00
Gerry Agbobada
a7c58380fa Add dap-cpptools to auto-requires of dap for rust
dap-cpptools is, for the time being, the recommended way of setting up 
dap-mode with Rust.
2021-07-18 16:02:41 +02:00
Henrik Lissner
9218473c7c Fix #4865: fix deprecation notice on define-minor-mode 2021-04-15 18:59:31 -04:00
Henrik Lissner
a724771d1e Merge pull request #4708 from he-la/develop
Fix +debug/start for dap-based debuggers.
2021-03-05 20:14:11 -05:00
Henrik Lissner
6127d15cea tools/debugger: use realgud:trepanpl for raku-mode 2021-03-05 20:09:22 -05:00
Henrik Laxhuber
8c33866b21 Forgot to add use-package! for projectile-variable 2021-02-28 23:07:27 +01:00
Henrik Lissner
f6aa50e1bc Load dap-mode after lsp-mode manually
:after complicates use-package load-order of its keywords, making it
difficult for users to guess how to remove the dap-tooltip-mode :hook.
We'll just do it ourselves.
2020-10-10 13:50:57 -04:00
Henrik Lissner
e2658052af tools/debugger: fix rust debugger
Was waiting for rust-mode, when it should be waiting for rustic-mode.
2020-09-19 14:22:52 -04:00
Henrik Lissner
95c6c83a76 Fix #3798: fix keymap typo for +dap-running-session-mode 2020-08-21 15:49:39 -04:00
Henrik Lissner
bf4929f4df Fix #3760: bind SPC m d only when debugger is active 2020-08-20 17:23:45 -04:00
Henrik Lissner
aba2dcaf11 tools/debugger: bind SPC m d to dap-hydra
Closes #2955
2020-08-06 00:22:39 -04:00
Henrik Lissner
3afee78c8b tools/debugger: fix file-missing dap-ui-mode error 2020-08-06 00:22:39 -04:00
Henrik Lissner
d9fd738ba6 Fix #3695: load lsp-java for dap-mode 2020-08-05 19:26:59 -04:00
Henrik Lissner
b08f9c607d Fix #3671: some dap-mode libs not loading 2020-08-02 13:57:06 -04:00
Henrik Lissner
318b3ef238 tools/debugger: refactor dap lib loader 2020-08-01 15:15:59 -04:00
Henrik Lissner
8b81c4c72a Fix #3657: remove dap-java reference
It was removed upstream (and moved to lsp-java).
2020-07-31 03:18:09 -04:00
Gerry Agbobada
3e5b7cce3f [eglot] Add support for eglot lsp client in emacs
- Update README
- Add eglot-specifics to cc, rs, py, hs
  removing unused lsp-mode packages when eglot is active
- Add eglot-specific bindings
- Add doctor warnings for debugger +lsp and +peek
- Add eglot-backed lookup-handlers
- Add flycheck checker using eglot for :checkers
  syntax users (using flycheck/flycheck#1676 and
  flycheck/flycheck#1592 discussion).
  This implementation is based on @marsam code, and uses recent
  Flycheck development in order to make the code smaller and
  easier to maintain.
2020-05-28 09:34:10 +02:00
Felix Clark
95824c5054 obviate helper function with after! 2020-05-14 17:40:59 -04:00
Felix Clark
7f201fc13e Following doom style guide 2020-05-12 11:31:03 -04:00
Felix Clark
cdd5e3931f activating dap web modules in TS mode 2020-05-12 10:19:15 -04:00
Henrik Lissner
09f617de8b tools/debugger: move dap-mode behind +lsp flag
+ To make this consistent with other opt-in LSP integration
+ Install posframe for dap-ui-mode to work (#2934)

Fixes #2934
2020-04-18 20:22:40 -04:00
Henrik Lissner
51944fae01 Refactor dap-mode and fix config load order
Now doom's defaults will run *before* a user's after! or use-package!
blocks for dap-mode.
2020-04-17 22:03:47 -04:00
Henrik Lissner
dd402b7db3 Remove references to enh-ruby-mode 2020-03-12 11:29:54 -04:00
Henrik Lissner
176be128ef gdb-show-main = gdb-many-windows = t 2020-02-16 02:26:38 -05:00
Tim Sanders
7541611863 Fix garbage minibuffer history when launching debugger
9a93aa1df9 (commitcomment-36934820)
2020-01-23 10:22:04 -06:00
Henrik Lissner
eba070d8ba Move dap-breakpoints-file to doom etc dir #2273 2019-12-30 05:26:57 -05:00
Henrik Lissner
adc8cba14b Revise docstrings & minor reformatting 2019-12-26 01:41:44 -05:00
Sean Farley
b8948aa6ef dap-mode: set extensions variable to doom-cache
Previously, this would put the .extension directory in
`user-emacs-directory' which in doom's case will be in the root of the
doom directory.

So, we move the directory to doom's etc dir and also name it something
descriptive instead of 'extension'.
2019-12-24 16:56:07 -08:00
Henrik Lissner
e0bd046339 tools/debugger: fix dap-mode not loading after lsp-mode 2019-12-20 04:17:45 -05:00
Henrik Lissner
9a93aa1df9 tools/debugger: fix invalid-function "..." error
...when invoking debugger, due to minibuffer-history being evaluated for
some reason.
2019-11-25 18:39:51 -05:00
Akhil Wali
8129112e59 Check if evil-emacs-state-local-map is bound 2019-10-10 22:35:26 +13:00
Julian DeMille
3e7bcda04a tools/debugger: Add rust binding for dap-lldb (#1677)
* Add Rust binding to dap-mode in :tools debugger
* Fix missing ).
2019-08-17 16:03:57 -04:00
Henrik Lissner
82ae3a73f3 def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
Henrik Lissner
76cacb5bfe 💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
8e09b8b7fe tools/debugger: conform to new advice conventions 2019-07-22 23:51:12 +02:00
Henrik Lissner
95a6a2baaf tools/debugger: add lldb & gdb dap debuggers
And refactors/reformats how dap modules are loaded.
2019-07-09 21:32:09 +02:00