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

fix(python): added debugpy path auto-resolution using mason-registry #367

Merged
merged 2 commits into from
Jul 5, 2023
Merged

fix(python): added debugpy path auto-resolution using mason-registry #367

merged 2 commits into from
Jul 5, 2023

Conversation

BillKills974
Copy link
Contributor

Mason installs debugpy in a venv in $HOME/.local/share/$NVIM_APPNAME/mason/packages/debugpy/ .
This fixes a bug where DAP would not find debugpy (ModuleNotFoundError : no module named "debugpy") and would not start debugging.
The replaced code would only work if you just installed debugpy or running :DapInstall python and use DAP without exiting nvim, or if you had debugpy installed system-wide (via pip) and not using a venv. It would fail upon new nvim runs.

Mason installs debugpy in a venv in $HOME/.local/share/$NVIM_APPNAME/mason/packages/debugpy/ .
This fixes a bug where DAP would not find debugpy (ModuleNotFoundError : no module named "debugpy") and would not start debugging. The replaced code would only work if you just installed debugpy or running :DapInstall python and use DAP without exiting nvim, or if you had debugpy installed system-wide (via pip) and not using a venv. It would fail upon new nvim runs.
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Proper usage of opts table rather than setting things up with the config function.

@BillKills974 BillKills974 changed the title BUGFIX: added debugpy path auto-resolution using mason-registry fix(pack.python): added debugpy path auto-resolution using mason-registry Jul 5, 2023
@BillKills974 BillKills974 changed the title fix(pack.python): added debugpy path auto-resolution using mason-registry fix(python): added debugpy path auto-resolution using mason-registry Jul 5, 2023
Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

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

Thanks for this! I think we can also go ahead and extend the config function here to pass the opts into the setup call as the second argument. This will allow users to easily use the opts key in lazy to override the options in the setup without losing the mason addition

lua/astrocommunity/pack/python/init.lua Outdated Show resolved Hide resolved
Added opts pass-through to setup function

Co-authored-by: Micah Halter <[email protected]>
Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

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

Perfect! I will go ahead and merge this :) Thanks so much! I think I also have some other ideas to improve this integration with mason, so I'll make a follow up PR as well :)

@mehalter mehalter merged commit 7133cbd into AstroNvim:main Jul 5, 2023
@BillKills974 BillKills974 deleted the patch-1 branch July 5, 2023 22:35
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