Add Neovim DAP debugging support via fm nvim command#378
Draft
ananyo141 wants to merge 5 commits intortCamp:developfrom
Draft
Add Neovim DAP debugging support via fm nvim command#378ananyo141 wants to merge 5 commits intortCamp:developfrom
fm nvim command#378ananyo141 wants to merge 5 commits intortCamp:developfrom
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
fm nvim command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the
fm nvimcommand to provide first-class Neovim debugging support for Frappe developers. Similar to howfm codeprovisions VSCode environments,fm nvim --debuggerautomates the setup for Neovim users by generating a project-local.nvim.luafile.This configuration seamlessly integrates with
nvim-dap(and optionallynvim-dap-uiandnvim-dap-python) to allow attaching to the Frappe dev-server, debugging background workers, or executing specific Frappe functions withdebugpyalready configured for the Docker container.Proposed Changes
fm nvim): Added tofrappe_manager/commands/nvim.pywith--debugger(creates.nvim.lua) and--work-dirflags.setup_neovim_debuggerand_sync_nvim_config_filesinbench_devtools.pyto handle the generation and safe-backup of the.nvim.luaworkspace config.NVIM_DAP_LUAscript string insite_manager/__init__.py. This Lua script:debugpyprocesses before launch.nvim-dapconfigs: fm-frappe-debug, Debug Specific Queue, and Debug Specific Function.FmDebugStart,<leader>ds).ruffanddebugpyin the container's bench environment during setup.README.mdand CLIexamples.jsonto highlight Neovim integration.test_nvim_command.pyandtest_bench_devtools_nvim.py) verifying the command flags, config backups, and Lua file contents.Testing Instructions
fm start mybench.localhost).fm nvim mybench.localhost --debugger..nvim.luais successfully created at the root of the bench workspace (<bench_path>/workspace/frappe-bench/.nvim.lua).vim.opt.exrc = trueto allow local config execution.nvim-daprecognizes the Frappe configurations and that commands like:FmDebugStartexecute and attach to the containerizeddebugpysession.pytest tests/unit/cli/test_nvim_command.py tests/unit/site_manager/test_bench_devtools_nvim.pyChecklist
README.md,examples.json).