Comments (5)
I got it to work by following your comment on Django #7 (comment)
- Instead of running uvicorn directly, I am calling main.py which has
import uvicorn
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
- install debugpy inside the project virtualenv
for me that is
poetry run pip install -U debugpy
- launch application using debugpy
python -m debugpy --listen 5678 --wait-for-client main.py
- inside Neovim start nvim-dap and use Attach remote configuration, when asked continue with default server host and port
alternatively, I also had success with this configuration:
table.insert(dap.configurations.python, {
type = 'python',
request = 'launch',
name = 'FastAPI',
program = vim.fn.getcwd() .. '/main.py',
pythonPath = function()
return 'python'
end,
})
then the application runs in a terminal window inside Neovim
from nvim-dap-python.
Started work on this in #21
from nvim-dap-python.
Looks like debugpy is trying to use an extension to the debug adapter protocol.
The debugpyAttach
event is not part of the core protocol.
According to their wiki this event is generated when the debugger detects a subprocess.
This might be something for nvim-dap-python as I'm not going to merge debug adapter specific extensions to nvim-dap, and nvim-dap extensions have the possibility to handle custom events.
What's a bit problematic is that it is not documented how the client is supposed to handle these custom events.
from nvim-dap-python.
Thank you, i'll close this issue and reopen in nvim-dap-python.
from nvim-dap-python.
This should now be working with a debugpy version installed from git and with latest nvim-dap master.
(If it doesn't, please comment with a minimal reproduction so I can re-open and look into it)
from nvim-dap-python.
Related Issues (20)
- Setup with lazyvim (incl django launcher)
- This function requires 1 argument(s) but instead it is receiving 0. [missing-parameter] ~Lua Diagnostics. HOT 1
- Error running [...]/.local/share/nvim/mason/packages/debugpy/venv/bin/python: ENOENT: no such file or directory HOT 5
- Debugger current working directory HOT 1
- crash on input()
- unintuitive configuration on Windows HOT 1
- debugging a flask application crashes before starting HOT 1
- Provide more configuration examples HOT 1
- Windows venv detection HOT 3
- Custom visualization of dataframes HOT 2
- how to debug with arguments?
- Debugpy - Windows HOT 4
- ModuleImportError when running from Pyenv HOT 6
- [Feature Request] `test_file`, `test_dir` & `test_all` HOT 2
- Help needed for compatibility with nvim-lua/kickstart HOT 1
- `os.fork` indefinitely waiting HOT 1
- Django and multiprocess HOT 8
- regression on detection of python bin HOT 1
- Debugging pytest test method fails on dap.continue() but works with dep.test_method() HOT 3
- type python deprecated in favor of debugpy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-dap-python.