Skip to content

Instantly share code, notes, and snippets.

@odev954
Last active February 2, 2022 17:40
Show Gist options
  • Save odev954/86a126f39ae1033b74d7d87d98034a18 to your computer and use it in GitHub Desktop.
Save odev954/86a126f39ae1033b74d7d87d98034a18 to your computer and use it in GitHub Desktop.
VSCode Extensions & Config Files For MYFS (Lesson #15)

VSCode Extensions & Config Files For MYFS (Lesson #15)

This README file is provided for 2nd year Magshimim students. This file includes a list of recommanded extensions for vscode development environment, installations, build and debug comfiguration files.

You can install VSCode via your app store, package manager, via snapcraft or directly from the site.

VSCode Recommanded Extensions

Development

  1. C/C++
  2. CMake
  3. CMake Tools
  4. Tabnine AI
  5. GitLens

Analysis Tools

  1. Hex Editor
  2. hexdump for VSCode

Personalization

  1. EasyZoom
  2. vscode-icons
  3. One Dark Pro
  4. Todo Tree
  5. Office Viewer(Markdown Editor)

Pre-Installations

Please run the following commands:

sudo apt install g++ cmake

This command will install the g++ compiler for C/C++ and the cmake build tools.

Config Files

To build, execute and debug our project, VSCode is using configuration files to describe what he needs to do. Those files include refrences to executable files, commands that needed to be executed, command line arguments and more.

In this gist you have 2 more files: launch.json and tasks.json. They both needed to be included inside a directory called .vscode that has to be placed in the same directory where your project files are.

Just create .vscode directory and download the 2 config files and save them in it.

  ______    ______    ______   _______         __       __    __   ______   __    __ 
 /      \  /      \  /      \ |       \       |  \     |  \  |  \ /      \ |  \  /  \
|  $$$$$$\|  $$$$$$\|  $$$$$$\| $$$$$$$\      | $$     | $$  | $$|  $$$$$$\| $$ /  $$
| $$ __\$$| $$  | $$| $$  | $$| $$  | $$      | $$     | $$  | $$| $$   \$$| $$/  $$ 
| $$|    \| $$  | $$| $$  | $$| $$  | $$      | $$     | $$  | $$| $$      | $$  $$  
| $$ \$$$$| $$  | $$| $$  | $$| $$  | $$      | $$     | $$  | $$| $$   __ | $$$$$\  
| $$__| $$| $$__/ $$| $$__/ $$| $$__/ $$      | $$_____| $$__/ $$| $$__/  \| $$ \$$\ 
 \$$    $$ \$$    $$ \$$    $$| $$    $$      | $$     \\$$    $$ \$$    $$| $$  \$$\
  \$$$$$$   \$$$$$$   \$$$$$$  \$$$$$$$        \$$$$$$$$ \$$$$$$   \$$$$$$  \$$   \$$
                                                                                     
                                                                                     :)
{
"version": "0.2.0",
"configurations": [
{
"name": "debugger (gdb)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/myfs", // path to executable
"args": ["disk"], // the path of the provided block device file, change it if you need
"stopAtEntry": false,
"cwd": "${workspaceFolder}", //working directory (current directory)
"environment": [],
"externalConsole": false,
"MIMode": "gdb", //debugger name
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "cmake build", // run cmake build task
"miDebuggerPath": "/usr/bin/gdb" //debugger executable path
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "cmake build", //name of task
"command": "make", //run the make command to execute the MakeFile (that is used to compile the program)
"args": [],
"options": {
"cwd": "${workspaceFolder}" //working directory (current directory)
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment