Skip to content

Commit

Permalink
Merge pull request godotengine#1890 from mijo-gracanin/master
Browse files Browse the repository at this point in the history
Add instructions for configuring VS Code
  • Loading branch information
akien-mga authored Nov 20, 2018
2 parents 2b6f675 + b826cd9 commit d146b1c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions development/cpp/configuring_an_ide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Development Environment), here are setup instructions for some popular ones:
- :ref:`Kdevelop <doc_configuring_an_ide_kdevelop>` (all desktop platforms)
- :ref:`Xcode <doc_configuring_an_ide_xcode>` (macOS)
- :ref:`Visual Studio <doc_compiling_for_windows_install_vs>` (Windows)
- :ref:`Visual Studio Code<doc_configuring_an_ide_vscode>` (all desktop platforms)

It is possible to use other IDEs, but their setup is not documented yet.

Expand Down Expand Up @@ -258,3 +259,42 @@ Test it:

- Set a breakpoint in platform/osx/godot_main_osx.mm
- It should break at the point!


.. _doc_configuring_an_ide_vscode:

Visual Studio Code
------------------

- Ensure that C/C++ extension is installed. You can find instructions in `docs <https://code.visualstudio.com/docs/languages/cpp>`_.

- Now open cloned godot folder in VS Code (File > Open Folder...)

In order to build the project, we need configurations files: *launch.json* and *tasks.json*.
To create them:

- Open Debug view (Ctrl + Shift + D) and select cogwheel with orange dot:

.. image:: img/vscode_1_create_launch.json.png

- Select *C++ (GDB/LLDB)* (it might be slightly differently called on macOS or Windows)

- Update *launch.json* to match:

.. image:: img/vscode_2_launch.json.png

(Note that *godot.x11.tools.64* in "program" value might be differently called on macOS or Windows)

- Create *tasks.json* by starting Debug process (F5). VS Code will show dialog with *Configure Task* button. Tap it and select *Create tasks.json file from template*, then select *Others*

- Update *tasks.json* to match:

.. image:: img/vscode_3_tasks.json.png

(Note that *platform=x11* will be different for macOX and Windows)

- You can now start Debug process again to test that everything works.

- If build phase fails, check console for hints. On Linux it's most likely that some dependencies are missing. Check :ref:`Compiling for X11 (Linux, \*BSD) <doc_compiling_for_x11>`


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added development/cpp/img/vscode_2_launch.json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added development/cpp/img/vscode_3_tasks.json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d146b1c

Please sign in to comment.