add minimal VS Code project config (#2393)

* add minimal VSCode project config

* update docs

* add extension recommendations


Co-authored-by: Itay Cohen <itaycohen23@gmail.com>
This commit is contained in:
Surendrajat 2020-08-24 20:03:29 +05:30 committed by GitHub
parent 05af1c6404
commit abe43262c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 10 deletions

4
.gitignore vendored
View File

@ -75,7 +75,9 @@ compile_commands.json
docs/source/_build
# vscode
**/.vscode
/.vscode/*
!/.vscode/settings.json
!/.vscode/extensions.json
# Visual Studio CMake
src/out

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"twxs.cmake"
]
}

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"cmake.sourceDirectory": "${workspaceFolder}/src",
"cmake.configureSettings": {
"CUTTER_USE_BUNDLED_RADARE2": "ON"
}
}

View File

@ -86,23 +86,24 @@ Recommended plugins
Project setup
~~~~~~~~~~~~~
- :menuselection:`File --> Open Folder` select the folder in which you cloned Cutter
- If the recommend plugins are already installed, in the corner you will see a popup asking you "Would you like to configure project 'cutter'? Source: CMake Tools (Extension)". Click Yes.
- If you initially dismissed the configuration window or didn't have the plugins installed yet - open command pallet using :kbd:`Ctrl-Shift-P` and select :guilabel:`Cmake: Configure`
- In the kit selection choose :guilabel:`[Unspecified]` unless you have more specific needs.
- If you see the following error: "CMakeList.txt was not found in the root of folder cutter", choose :guilabel:`Locate` and specify the path to :file:`cutter/src/CMakeLists.txt`
- :kbd:`Ctrl-Shift-P`/:guilabel:`CMake: Edit CMake Cache`, find the line ``CUTTER_USE_BUNDLED_RADARE2:BOOL=OFF`` and change it to ON.
- :menuselection:`File --> Open Folder...` and select the folder in which you cloned Cutter
- Install the recommended plugins.
- Once the `CMake Tools` plugin is installed, in the corner you will see a popup asking you "Would you like to configure project 'cutter'? Source: CMake Tools (Extension)". Click Yes.
- In the kit selection popup, choose :guilabel:`[Unspecified]` unless you have more specific needs.
- If you initially dismissed the configuration window or didn't have the plugins installed yet - open command-palette using :kbd:`Ctrl-Shift-P` and select :guilabel:`Cmake: Configure`
Changing CMake configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After the first configuration :kbd:`Ctrl-Shift-P`/:guilabel:`CMake: Edit CMake Cache` opens a text editor with all CMake options. Cutter specific ones mostly start with "CUTTER".
.. note::
``CUTTER_USE_BUNDLED_RADARE2`` option is also defined in ``.vscode/settings.json`` file and it will be overridden from there. It is set to ``ON`` by default as it is recommended during development.
.. _vscode-debug-setup:
Building, Running, Debugging
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build and running commands are available in the bar at the bottom left and in the Command Palette menu (:kbd:`Ctrl-Shift-P`) named ``CMake: Build F7``, ``CMake: Run Without Debugging Shift+F5``, and ``CMake Debug Ctrl + F5``.
Build and running commands are available in the status bar at the bottom and in the Command Palette menu (:kbd:`Ctrl-Shift-P`) named ``CMake: Build F7``, ``CMake: Run Without Debugging Shift+F5``, and ``CMake Debug Ctrl + F5``.
Shortcuts can be viewed in the :kbd:`Ctrl-Shift-P` menu. They don't match default VS Code ones since those depend on :file:`tasks.json``.
Running and debugging launches the executable without any arguments. Command-line arguments can be passed to the debug