From ccd81c3021ad084820ab0002bef4394f252c2094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0ourek?= Date: Tue, 28 Feb 2023 15:19:43 +0100 Subject: [PATCH 1/2] dap-python, flask, resolving documentation conflicts --- dap-python.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dap-python.el b/dap-python.el index 4eb6b590..7473143f 100644 --- a/dap-python.el +++ b/dap-python.el @@ -221,10 +221,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 (" Date: Tue, 28 Feb 2023 15:21:25 +0100 Subject: [PATCH 2/2] Forgot to add configuration documentation --- docs/page/configuration.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/page/configuration.md b/docs/page/configuration.md index d72d608e..90cef0bb 100644 --- a/docs/page/configuration.md +++ b/docs/page/configuration.md @@ -117,6 +117,33 @@ settings. :request "launch" :name "My App")) ``` + 2.1 Flask app + + Default template from vscode can be used to launch flask app. Please create file **launch.json** in **.vscode** subfolder of project's root folder. And the contents can look like this example. + ``` + { + "version": "0.2.0", + "configurations": [ + { + "name": "", + "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