VSCode - ktopolov/DatabaseSystem GitHub Wiki
Visual studio code is a lightweight editor with plugins available to run and debug Python, C++, etc. and perform automatic linting. Watch this video for setup: https://www.youtube.com/watch?v=-nh9rCzPJ20
Download link is here: https://code.visualstudio.com/download
Download These Extensions
- C/C++ : C++ debugging, syntax highlighting etc.
- CMake : Build system for C++
- CMake Tools : Build system for C++
- Python : Debugging and syntax
- Code Runner : Run code from various languages
- Jupyter : Jupyter notebook Python support
These will grab you some other packages automatically as well.
To configure your VSCode, go to the settings button in the bottom left. Then click settings. You can select the desired options. Alternatively, you can click "Edit in settings.json", a file stored within the .vscode/
directory automatically. Third option is click CTRL + SHIFT + P
and type "Settings.json"; you'll see the option come up. This file is updated whenever you change your settings using the GUI. Directly editing this file is a good way to change settings from default. An example is shown here:
*** settings.json *** (NOT PART OF FILE)
{
"window.zoomLevel": 1,
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
"python.defaultInterpreterPath": "~/anaconda3/bin/python",
"editor.formatOnSave": true // Format code to look nice on saving
}
Python Setup
Select default virtual environment. I have Anaconda and this Python venv should be on my system path. I run:
which python
Output is:
/home/ktopolov/anaconda3/bin/python
Then I add the path to the venv in my settings.json
as:
{
"python.defaultInterpreterPath": "/home/ktopolov/anaconda3/bin/python"
}
I then want to create a debug configuration to debug Python files.