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

Add way to provide extra initCommands #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gollth
Copy link

@gollth gollth commented Jan 16, 2025

Hello,

first of all thanks for this great plugin, it's my daily driver for a long time one 🙏

I have a particular feature that I'm lacking or don't know how to achieve in rustaceanvim when it comes to debugging: I have a custom lldb init script in my repo (which adds some custom formatters) which I want to apply to every debuggable target there is (executables, nvim-dap targets & neotest debug targets), when using the codelldb adapter.

AFAIK I can only provide initCommands in the .vscode/launch.json, which works for executables, but not for the tests, right?

My idea was let the user configure an optional command in its config, which gets appended to all other init commands of all targets. My user config now looks like this:

  {
    "mrcjkb/rustaceanvim",
    dependencies = { "mfussenegger/nvim-dap" },
    version = "^5",
    lazy = false,
    ft = { "rust" },
    opts = {
      dap = {
        autoload_configurations = true,
        init_commands = "command script import ./lldb/fleet.py",
      },
    }
    -- other config...
}

Maybe there is another already built in way how to solve this, comments very welcome (=

Copy link
Contributor

Review Checklist

Does this PR follow the Contribution Guidelines? Following is a partial checklist:

Proper conventional commit scoping:

  • For example, fix(lsp): some lsp-related bugfix

  • Pull request title has the appropriate conventional commit prefix.

If applicable:

  • Tested
    • Tests have been added.
    • Tested manually (Steps to reproduce in PR description).
  • Updated documentation.

Copy link
Owner

@mrcjkb mrcjkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey 👋

Thanks for the PR.
Is something like this supported by the rust-analyzer VSCode plugin or by rust-analyzer?
If not, I'd prefer it be requested there first.

Adding it to the rustaceanvim config feels quite hacky. I'd potentially be open to a more general solution, in which rustaceanvim doesn't have to be concerned with which extra fields are added to the DAP configurations.

@mrcjkb mrcjkb enabled auto-merge (squash) January 19, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants