-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Automatic setup doesn't work with codelldb on Windows #51
Comments
I did some digging and I have an inclination of what to do but I'm new to all of the mason code and ecosystem so I'm not 100% sure this is the best approach. In
I did test this change and the automatic setup works perfectly now. Does anyone know if |
Looks like mason-lspconfig.nvim uses
Here's a similar issue on mason.nvim with some related details. |
I tested out |
Adds several plugins to Neovim configuration to support the Debug Adapter Protocol (DAP). This enables VSCode-like debugging within Neovim. Debug adapters can be installed via :Mason. Note: there is currently a bug with mason-nvim-dap's automatic_setup. Debug adapters installed via :Mason are not setup properly on Windows (see jay-babu/mason-nvim-dap.nvim#51). Until this is fixed, a workaround is to add 'vim.fn.exepath()' to the 'command' section of adapters.lua within the mason-nvim-dap source.
@aosterhage, do you mind creating a PR for codellb cmd changes? If everything works fine for a week or 2, this can be expanded to all other adapters. I am out of town otherwise I would do it right now |
Mason.nvim utilizes symlinks to organize package files. On Windows symlink support is complicated and so mason chooses to use .cmd script files to simplify things. Setting "command" to "codelldb" will only look for files with the name "codelldb", i.e. it will not find "codelldb.cmd". This commit changes "command" to use vim.fn.exepath() which seems to find any executable file with an equivalent stem. This means it will find both files "codelldb" and "codelldb.cmd". Change-Id: Ibd8d63a8d4e4ef9f3744db7eda1c532226484921
Mason.nvim utilizes symlinks to organize package files. On Windows symlink support is complicated and so mason chooses to use .cmd script files to simplify things. Setting "command" to "codelldb" will only look for files with the name "codelldb", i.e. it will not find "codelldb.cmd". This commit changes "command" to use vim.fn.exepath() which seems to find any executable file with an equivalent stem. This means it will find both files "codelldb" and "codelldb.cmd". Change-Id: I09b185aaa5d5141e304e8a80fe8ea0ab08c03f17
Mason.nvim utilizes symlinks to organize package files. On Windows symlink support is complicated and so mason chooses to use .cmd script files to simplify things. Setting "command" to "codelldb" will only look for files with the name "codelldb", i.e. it will not find "codelldb.cmd". This commit changes "command" to use vim.fn.exepath() which seems to find any executable file with an equivalent stem. This means it will find both files "codelldb" and "codelldb.cmd".
Opened #52 with the fix. I tested on Windows using a fresh configuration (deleted both
After a |
Mason.nvim utilizes symlinks to organize package files. On Windows symlink support is complicated and so mason chooses to use .cmd script files to simplify things. Setting "command" to "codelldb" will only look for files with the name "codelldb", i.e. it will not find "codelldb.cmd". This commit changes "command" to use vim.fn.exepath() which seems to find any executable file with an equivalent stem. This means it will find both files "codelldb" and "codelldb.cmd".
I replicated the same test as my previous comment in Linux and everything continued working as expected. |
Thanks! Do you think it's a good idea to let this change boil for some time before applying everywhere? |
I think either way is fine, waiting or not. I don't see much that can go wrong: Something we should talk about is if there are any other implications of using If I look at my If for some reason we want to specifically target only the mason binaries then we can do something like this:
But I don't really like diving into the mason package paths when it provides a nice |
One more thing to consider before applying this to other adapters: do we want to only do this for Windows like mason-lspconfig with a |
This can be expanded to use exepath for all places. I am not worried about if enforcing the mason dependency being installed. It has to be otherwise it won't work anyways. I can create a PR next week unless you want to. Thanks for finding this! No need to lock down to windows. |
Thanks for this! |
Thank you for the plugin! |
I want to preface by saying that I assume this will be the case for all adapters installed via
mason.nvim
on Windows.I've installed
codelldb
viamason.nvim
and done the typical setup:This does configure
dap.adapters.codelldb
but with the following values:Running
:DapContinue
will prompt nvim-dap to ask for the executable location and once provided will error out on:Enabling DEBUG level logs in nvim-dap shows:
which is the same configuration that
mason-nvim-dap.nvim
has setup viaautomatic_setup
. The issue is that, for whatever reason,codelldb
is not recognized as a file butcodelldb.cmd
is since this is the file actually installed by mason:If I modify the configuration like so:
then everything works great. But this defeats the purpose of
automatic_setup
for me.I've been saying that I'm on Windows because I'm assuming its important but I don't actually know yet as I haven't tested on Linux (which I can if needed). I'm assuming Linux works or someone would have noticed by now.
The text was updated successfully, but these errors were encountered: