feat: add vscode debugger

This commit is contained in:
Terminator 2023-11-30 00:14:57 -03:00
parent 38601033af
commit 2db2cdc1ff
3 changed files with 37 additions and 0 deletions

16
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Main.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/src/main.py",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
"preLaunchTask": "Setup Environment",
}
]
}

12
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Setup Environment",
"type": "shell",
"command": "python",
"args": ["activate_env.py"],
"problemMatcher": []
}
]
}

9
activate_env.py Normal file
View File

@ -0,0 +1,9 @@
import subprocess
import os
# Ativa o ambiente virtual
subprocess.run([r'.\venv\Scripts\activate.bat'], shell=True)
# Configura as variáveis de ambiente
os.environ['PATH'] = r'.\bin;' + os.environ['PATH']
os.environ['PYTHONUTF8'] = '1'