From aadb0a813980fe3a10b6fc4469b68cec702c3116 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Tue, 30 Nov 2021 17:27:25 +0530 Subject: [PATCH] feat: allow devcontainer vscode configuration --- development/.vscode/settings.json | 4 ---- development/README.md | 8 ++++++++ development/{.vscode => vscode-example}/launch.json | 5 +++++ development/vscode-example/settings.json | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) delete mode 100644 development/.vscode/settings.json rename development/{.vscode => vscode-example}/launch.json (86%) create mode 100644 development/vscode-example/settings.json diff --git a/development/.vscode/settings.json b/development/.vscode/settings.json deleted file mode 100644 index 78469229..00000000 --- a/development/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "python.pythonPath": "frappe-bench/env/bin/python", - "debug.node.autoAttach": "disabled" -} \ No newline at end of file diff --git a/development/README.md b/development/README.md index c4b6ca11..48760cf9 100644 --- a/development/README.md +++ b/development/README.md @@ -28,6 +28,12 @@ Copy example devcontainer config from `devcontainer-example` to `.devcontainer` cp -R devcontainer-example .devcontainer ``` +Copy example vscode config for devcontainer from `development/vscode-example` to `development/.vscode`. This will setup basic configuration for debugging. + +```shell +cp -R development/vscode-example development/.vscode +``` + ## Use VSCode Remote Containers extension For most people getting started with Frappe development, the best solution is to use [VSCode Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). @@ -208,6 +214,8 @@ You can now login with user `Administrator` and the password you choose when cre To debug workers, skip starting worker with honcho and start it with VSCode debugger. +For advance vscode configuration in the devcontainer, change the config files in `development/.vscode`. + ## Developing using the interactive console You can launch a simple interactive shell console in the terminal with: diff --git a/development/.vscode/launch.json b/development/vscode-example/launch.json similarity index 86% rename from development/.vscode/launch.json rename to development/vscode-example/launch.json index 8cd61e74..0c8046bb 100644 --- a/development/.vscode/launch.json +++ b/development/vscode-example/launch.json @@ -12,6 +12,7 @@ "args": [ "frappe", "serve", "--port", "8000", "--noreload", "--nothreading" ], + "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -25,6 +26,7 @@ "args": [ "frappe", "worker", "--queue", "default" ], + "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -38,6 +40,7 @@ "args": [ "frappe", "worker", "--queue", "short" ], + "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -51,6 +54,7 @@ "args": [ "frappe", "worker", "--queue", "long" ], + "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench/sites", "env": { "DEV_SERVER": "1" @@ -61,6 +65,7 @@ "type": "python", "request": "launch", "program": "/home/frappe/.local/bin/honcho", + "pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python", "cwd": "${workspaceFolder}/frappe-bench", "console": "internalConsole", "args": [ diff --git a/development/vscode-example/settings.json b/development/vscode-example/settings.json new file mode 100644 index 00000000..b0f14919 --- /dev/null +++ b/development/vscode-example/settings.json @@ -0,0 +1,3 @@ +{ + "debug.node.autoAttach": "disabled" +} \ No newline at end of file