Created
November 4, 2021 23:58
-
-
Save luizomf/276820fed43130edaf4fa8ab3c57a0a1 to your computer and use it in GitHub Desktop.
Configuração do VS Code para Python e Django.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"window.zoomLevel": 0, | |
"python.languageServer": "Pylance", // ms-python.vscode-pylance | |
"python.testing.unittestEnabled": false, // ms-python.python | |
"python.testing.pytestEnabled": true, | |
"python.testing.pytestArgs": [], // -x to bail | |
"python.linting.flake8Enabled": true, | |
"python.linting.mypyEnabled": true, | |
"python.linting.pylintArgs": [ | |
"--load-plugins=pylint_django", | |
"--errors-only" | |
], | |
"python.formatting.autopep8Args": ["--indent-size=4"], | |
"python.defaultInterpreterPath": "venv/bin/python", | |
"[python]": { | |
"editor.defaultFormatter": "ms-python.python", // ms-python.python | |
"editor.tabSize": 4, | |
"editor.insertSpaces": true, | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"editor.codeActionsOnSave": { | |
"source.organizeImports": true | |
} | |
}, | |
"[html]": { | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "vscode.html-language-features", | |
"editor.quickSuggestions": { | |
"other": true, | |
"comments": true, | |
"strings": true | |
} | |
}, | |
"[django-html]": { | |
"editor.formatOnSave": false, | |
"editor.defaultFormatter": "vscode.html-language-features", | |
"editor.quickSuggestions": { | |
"other": true, | |
"comments": true, | |
"strings": true | |
} | |
}, | |
"files.associations": { | |
"*.js": "javascript", | |
"*.jsx": "javascriptreact", | |
"*.xml": "html", | |
"*.svg": "html", | |
"*.html": "html", | |
"django-html": "html", // batisteo.vscode-django | |
"**/*.html": "html", | |
"**/templates/**/*.html": "django-html", | |
"**/base_templates/**/*.html": "django-html", | |
"**/requirements{/**,*}.{txt,in}": "pip-requirements" | |
}, | |
"emmet.includeLanguages": { | |
"django-html": "html", // batisteo.vscode-django | |
"javascript": "javascriptreact", | |
"typescript": "typescriptreact" | |
} | |
} |
dcarnelossi
commented
Jun 25, 2024
Erro 1:
"source.organizeImports": true
// organizeImports vai ordenar os imprts, porém remover os imports não usados.
// Experimente trocar conforme abaixo para ordenar os imports, mas não remover os imports não usados.
"editor.codeActionsOnSave": {
//"source.organizeImports": true
"source.sortImports": "explicit"
}
Erro 2:
"editor.defaultFormatter": "ms-python.python"
- Basta instalar as extensoes indicadas no curso: ms-python.vscode-pylance e batisteo.vscode-django
As dicas acima resolveram tudo, valeu!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment