Skip to content

Commit

Permalink
Merge pull request #9116 from kitbdev/vscode-intellisense
Browse files Browse the repository at this point in the history
Add intellisense configuration for VSCode
  • Loading branch information
mhilbrunner committed Mar 22, 2024
2 parents df57799 + cf54259 commit 5671ae8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
Binary file not shown.
54 changes: 54 additions & 0 deletions contributing/development/configuring_an_ide/visual_studio_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,60 @@ The name under ``program`` depends on your build configuration,
e.g. ``godot.linuxbsd.editor.dev.x86_64`` for 64-bit LinuxBSD platform with
``platform=editor`` and ``dev_build=yes``.

Configuring Intellisense
------------------------

For the C/C++ extension:

To fix include errors you may be having, you need to configure some settings in the ``c_cpp_properties.json`` file.

- First, make sure to build the project since some files need to be generated.

- Edit the C/C++ Configuration file either with the UI or with text:

.. figure:: img/vscode_edit_configurations.webp
:align: center

- Add an include path for your platform, for example, ``${workspaceFolder}/platform/windows``.

- Add defines for the editor ``TOOLS_ENABLED``, debug builds ``DEBUG_ENABLED``, and tests ``TESTS_ENABLED``.

- Make sure the compiler path is configured correctly to the compiler you are using. See :ref:`doc_introduction_to_the_buildsystem` for further information on your platform.

- The ``c_cpp_properties.json`` file should look similar to this for Windows:

.. code-block:: js
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/platform/windows"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"TOOLS_ENABLED",
"DEBUG_ENABLED",
"TESTS_ENABLED"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
- Alternatively, you can use the scons argument ``compiledb=yes`` and set the compile commands setting ``compileCommands`` to ``compile_commands.json``, found in the advanced section of the C/C++ Configuration UI.

- This argument can be added to your build task in ``tasks.json`` since it will need to be run whenever files are added or moved.

If you run into any issues, ask for help in one of
`Godot's community channels <https://godotengine.org/community>`__.

Expand Down

0 comments on commit 5671ae8

Please sign in to comment.