Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't load DAP when it's not needed #2587

Open
RayJameson opened this issue May 11, 2024 · 5 comments
Open

Don't load DAP when it's not needed #2587

RayJameson opened this issue May 11, 2024 · 5 comments
Assignees
Labels
astronvim-next This is slated to be resolved in the next breaking release if AstroNvim enhancement New feature or request workaround A workaround has been provided/

Comments

@RayJameson
Copy link
Contributor

RayJameson commented May 11, 2024

Is your feature related to a problem?

I don't think DAP should be loaded unconditionally (I know it's lazy-loaded but it does load every time you open any file), because it's one of the slowest plugins (to load)

Describe the new feature

I think DAP and all related plugins (mason-nvim-dap, nvim-dap, cmp-dap) should be loaded only if you enter the debugger submenu by <Leader>d (maybe even for each keymap of this submenu) or using related cmds. It is still possible to install DAPs using Mason even if those plugins are not loaded

Additional context

for my own config I added init = function() end, in the mason-nvim-dap.nvim spec

@RayJameson RayJameson added the enhancement New feature or request label May 11, 2024
@mehalter
Copy link
Member

Thmhis is how it used to be out of the box but left users very confused when the ensure_installed table that automatically installed debuggers didn't do anything. For now we don't have a real path forward for this without greatly decreasing the out of box experience. For this reason we made it load on opening a file and made it so the user has to opt into more aggressive lazy loading like you have

@mehalter
Copy link
Member

mehalter commented May 11, 2024

Another option is to use the mason-tool-installer.nvim plugin for installing mason packages which is super great (this is what I use on my personal configuration) which also will move the lazy loading to being more aggressive for dap as the automatic installation is handled separately. It's available in AstroCommunity:

https://github.com/AstroNvim/astrocommunity/blob/main/lua%2Fastrocommunity%2Futility%2Fmason-tool-installer-nvim%2Finit.lua

I think I am leaning towards making this the default again. It was previously, but had a relatively slow startup time but I feel like that has improved.

I also think the way the spec is made in AstroCommunity could be considered a non-breaking change 🤔

@mehalter mehalter added the workaround A workaround has been provided/ label May 11, 2024
@mehalter
Copy link
Member

mehalter commented May 11, 2024

Ah actually, looking at this it looks like there is a part of the mason-tool-installer that does load the plugins for the mappings.... One sec that actually should probably be removed

Ah it is necessary to not be breaking because the installation mason plugins are required for some packages mappings

@mehalter mehalter added the astronvim-next This is slated to be resolved in the next breaking release if AstroNvim label May 11, 2024
@mehalter
Copy link
Member

mehalter commented May 12, 2024

@RayJameson So I got a new feature PR merged into mason-tool-installer to improve this (WhoIsSethDaniel/mason-tool-installer.nvim#49)

I will plan on making this a default in AstroNvim v5 with the integrations disabled by default.

In the meantime I would recommend the following adding the following to your community.lua file:

  { import = "astrocommunity.utility.mason-tool-installer" },

In AstroCommunity we are now disabling the other mason plugin integrations by default to default improve lazy loading which tends to be a main reason for using this plugin anyway. Then users can opt into the integrations that they way.

mehalter added a commit that referenced this issue May 12, 2024
@RayJameson
Copy link
Contributor Author

Nice! I'll stick to my workaround for now, but eventually, I'll move to the community plugin

@mehalter mehalter self-assigned this May 14, 2024
@mehalter mehalter reopened this May 14, 2024
shubhamku044 added a commit to shubhamku044/AstroNvim that referenced this issue May 22, 2024
* fix(autocmds): when triggering `AstroFile` events, only forward events for valid buffers

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.1.6

* fix: make sure `FileType` event is fired at the correct time after `AstroFile`

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.1.7

* fix(snapshot): require AstroCore v1.1.1 for important bug fix

* fix(mappings): clear up language of `<Leader>q` and `<Leader>Q` mappings

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.1.8

* fix(autocmds): check if buffer is valid before checking for file

* docs: add admonition for notes

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.1.9

* fix(comment): add missing `Comment.nvim` mappings for lazy loading

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.1.10

* refactor(comment): improve `keys` implementation for Comment.nvim

* perf(astrolsp): improve lazy loading of AstroLSP

* chore(snapshot): update `lazy_snapshot`

* docs: improve badge layout

* chore(main): release 4.1.11

* perf: optimize url highlighting auto command and disable for large buffers

* fix(autocmds): add missing `HighlightURL` default highlight group

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.1.12

* feat: add notification to recommend running `:Lazy update` again after AstroNvim updates

* chore(main): release 4.2.0

* fix(nvim-dap-ui): temporarily pin `nvim-dap-ui` to commit until next release

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.2.1

* fix(autocmds): typo in terminal_settings description (AstroNvim#2552)

* feat(alpha): show the actual leader key on the dashboard

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.3.0 (AstroNvim#2553)

* feat(mappings): backport new default neovim diagnostic and LSP mappings

This backports the following mappings:
- `crr` for code actions
- `crn` for lsp rename
- `<C-S>` for signature help (insert mode)
- `<C-W>d` for diagnostic hover

* fix(mappings): fix incorrectly normalized mappings

* chore(mappings): specify `silent = true` for `expr` mappings

* chore(colorizer): add todo to replace `nvim-colorizer` with `nvim-highlight-colors`

* chore: fix issue with GitHub issue template minimal reproduction Lua example

* fix: clear up language in update notification for AstroNvim

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.4.0 (AstroNvim#2556)

* fix(vim-illuminate): add missing `large_file_cutoff` default

* fix(smart-splits): disable aggressive lazy loading for multiplexer setup

* fix(cmp): update `vim.snippet` to use updated `active` API (AstroNvim#2560)

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.4.1 (AstroNvim#2562)

* docs: update the update command (AstroNvim#2564)

it looks like with the release of 4.0 AstroUpdatePackages was removed and AstroUpdate does the same thing (it calls astrocore and updates everything)

* fix(treesitter): guarantee mason loads before treesitter

Just in case the user has installed the tree-sitter-cli through Mason

* refactor: make sure empty `ensure_installed` tables are provided by default

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.4.2 (AstroNvim#2565)

* docs: update true color terminal link

* fix(telescope): only map Telescope's `live_grep` picker if `rg` is available

* fix(health): check for ripgrep (`rg`) executable

* chore(main): release 4.4.3 (AstroNvim#2566)

* fix: make `git` optional in the path for execution

* fix(comment): make `<Leader>/` dot-repeatable

Closes AstroNvim#2410

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.4.4 (AstroNvim#2567)

* feat(astrolsp): add global inlay hints toggle

* refactor(options): remove unnecessary vim options

* fix(astrolsp): remove unnecessary backported `<C-S>` mapping. This is actually a bug because it overwrites a separate AstroNvim default

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.5.0 (AstroNvim#2569)

* docs: bump minimum version

* refactor(options): set shiftwidth to automatically copy 'tabstop' value (AstroNvim#2573)

* fix: decouple mappings to make it easier to override them individually

Resolves AstroNvim#2574

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.5.1 (AstroNvim#2575)

* ci: add `version.txt`

* feat: add `:AstroVersion` for displaying current version

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.6.0 (AstroNvim#2576)

* chore: add missing github issue configuration

* perf(guess-indent): improve lazy loading (AstroNvim#2561)

this also moves to a maintained fork until PR is merged upstream

* fix(autocmds): respect modeline when forwarding events

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.6.1 (AstroNvim#2577)

* fix(mappings): remove neovim v0.10 lsp mappings as they got reverted

* fix(guess-indent): update to new API for silencing indentation notifications

* chore(main): release 4.6.2 (AstroNvim#2578)

* revert: use main upstream for `guess-indent` as lazy gets very confused

refs 4952573, c1e8e74

* chore(snapshot): update `lazy_snapshot`

* docs: fix README

* chore(main): release 4.6.3 (AstroNvim#2580)

* fix: notification deferment not playing nicely with `nvim-notify`

Resolves AstroNvim#2579

* chore(main): release 4.6.4 (AstroNvim#2582)

* perf(notify): optimize performance for notification pausing/resuming

* fix(cmp): `<C-N>` and `<C-P>` should start completion if not started

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.6.5 (AstroNvim#2583)

* fix: add missing windows `gdu` executable name possibility

Resolves AstroNvim#2585

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.6.6 (AstroNvim#2586)

* fix: astrocore spelling in require (AstroNvim#2588)

* chore(main): release 4.6.7 (AstroNvim#2589)

* chore(mason): add todo about plans for v5

ref AstroNvim#2587

* feat(astroui): add `runtime_condition` support to `null-ls` statusline integration

* chore(main): release 4.7.0 (AstroNvim#2591)

* fix(autocmd): typo in unlist qf description (AstroNvim#2597)

* fix(astroui): use single character icon for `DapLogPoint`

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.7.1 (AstroNvim#2598)

* fix(indent-blankline): limit updating of `indent-blankline` in Neovim <0.10

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.7.2 (AstroNvim#2600)

* fix(mappings): add missing default diagnostic mapping backport

* fix(mappings): add back next/previous diagnostic mappings to neovim 0.10

0.10 default diagnostic mappings call `vim.diagnostic.goto_{prev,next}({ float = false })`

* chore(snapshot): update `lazy_snapshot`

* docs: fix incorrect admonition syntax (AstroNvim#2602)

* chore(main): release 4.7.3 (AstroNvim#2601)

* fix(ts-context-commentstring): add support for native commenting in neovim 0.10+

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.7.4 (AstroNvim#2605)

* fix(astroui): do not overwrite `colors` when modified in place

* chore(snapshot): update `lazy_snapshot`

* chore(main): release 4.7.5 (AstroNvim#2606)

* fix(cmp): improve `cmp` visibility check

* chore: remove unnecessary feature

* refactor(astrolsp): remove usage of `server_capabilities`

---------

Co-authored-by: Micah Halter <micah@mehalter.com>
Co-authored-by: AstroNvim Bot <github@astronvim.com>
Co-authored-by: kabinspace <kabinspace@gmail.com>
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
Co-authored-by: Ilia Bahrebar <150489740+Std-Enigma@users.noreply.github.com>
Co-authored-by: Nicholas Ciechanowski <55490546+ALameLlama@users.noreply.github.com>
Co-authored-by: William Roy <wroy@proton.me>
Co-authored-by: Jay Patel <36803168+jay-babu@users.noreply.github.com>
Co-authored-by: Loi Chyan <loichyan@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astronvim-next This is slated to be resolved in the next breaking release if AstroNvim enhancement New feature or request workaround A workaround has been provided/
Projects
Status: Has Branch
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants