Recommended Packages:
Remote - SSH
GitLens
Ruff
Flake8:
To change Line Length for Flake8 do:
"flake8.args": [
"--max-line-length=120"
]
in the settings.json
I prefer editing the Workspace settings, namely <root project folder>/.vscode/settings.json
autoDocstring - Python Docstring Generator
Python (To Disable double envs like: (automl)(base)):
Didn't Work and:
conda config --set auto_activate_base False
: This worked
https://stackoverflow.com/questions/77410905
This will although show (automl) the actual env will be base env still
Open the settings (File > Preferences > Settings)
To change size of fonts in Tabs etc
Ctrl + and Ctrl - to change
Then adjust font size in editor with Ctrl and mouse scroll
For debugging:
and
in .vscode/launch.json or change to any path you like "cwd": "${fileDirname}"
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${fileDirname}"
}
]
}
Or just simply do:
import sys
sys.path.append()
To enable debugging inside installed packages do:
"justMyCode": false
Example
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "/home/rb/automltraining",
"justMyCode": false
}
]
}
VSCode can't open certain folder with remote ssh:
At windows client:
Delete all the folder in %USERPROFILE%\AppData\Roaming\Code\User\workspaceStorage
At linux client:
Delete all the folder in ~/.vscode/workspaceStorage or ~/.config/Code/User/workspaceStorage
For VSC Insiders, it's %USERPROFILE%\AppData\Roaming\Code - Insiders\User\workspaceStorage
View Markdown
Open VSCode settings.json file with;
Ctrl Shift P
Preferences: Open User Settings
Add these lines to json file before the last }
, // don't forget the comma
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor",
}
Then whenever you want, you can use code README.md command.
In my case:
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb",
"*.md": "vscode.markdown.preview.editor"
},
Netron
https://marketplace.visualstudio.com/items?itemName=vincent-templier.vscode-netron
View HTML directly
https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer
Right click html and open with Live Server
https://stackoverflow.com/questions/30039512/how-to-view-an-html-file-in-the-browser-with-visual-studio-code