dap-mode icon indicating copy to clipboard operation
dap-mode copied to clipboard

dap-python, Flask support

Open DJManas opened this issue 1 year ago • 1 comments

Now it should be all ok. Only thing left is what with the deprecated ptvsd, should I implement it also?

DJManas avatar Feb 28 '23 14:02 DJManas

I tried the changes PR makes in my emacs, with the following .vscode/launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python App",
            "type": "python",
            "request": "launch",
            "module": "flask",
            "env": {
		"FLASK_APP": "app.py",
		"FLASK_DEBUG": "0"
            },
            "args": [
		"run",
		"--no-debugger",
		"--no-reload"
            ],
            "jinja": false,
            "justMyCode": true
        }
    ]
}

I use direnv, and had to override dap-mode function like so:

(defun dap-python--pyenv-executable-find (command)
    (executable-find "python"))

Full config:

(use-package dap-mode
  :after lsp-mode
  :commands dap-debug
  :custom
  (setq dap-python-debugger 'debugpy)
  (setq dap-python-terminal "vterm")
  :config
  (dap-auto-configure-mode)
  (require 'dap-node)
  (require 'dap-python)
  ;; no support for direnv, the function uses pyenv’s modules if pyenv
  ;; is found in path
  (defun dap-python--pyenv-executable-find (command)
    (executable-find "python")))

Pleased to report that things work well!

codingquark avatar Oct 29 '23 10:10 codingquark