diff --git a/dap-python.el b/dap-python.el index 25688c23..21837910 100644 --- a/dap-python.el +++ b/dap-python.el @@ -225,10 +225,22 @@ strings, for the sake of launch.json feature parity." ;; them to unspecified instead. Some templates in this file set such ;; properties (e.g. :module) to nil instead of leaving them undefined. To ;; support them, sanitize CONF before passing it on. - (when program - (if module - (push program python-args) - (plist-put conf :program program))) + (if (string-equal module "flask") + ;; For flask module we need to strip filename from launch parameters + ;; parameters are mostly ("", + "type": "python", + "request": "launch", + "module": "flask", + "env": { + "FLASK_APP": "", + "FLASK_DEBUG": "1" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "jinja": true, + "justMyCode": true + } + ] + } + ``` 3. Template parameters