From 882d2a85bcfe031914d2f59c144b5a241afa4534 Mon Sep 17 00:00:00 2001 From: kit Date: Mon, 18 Mar 2024 19:36:59 -0400 Subject: [PATCH] Add intellisense configuration for VSCode (cherry picked from commit cf54259ff05e47f0edd5e329d32584f230a36880) --- .../img/vscode_edit_configurations.webp | Bin 0 -> 3544 bytes .../configuring_an_ide/visual_studio_code.rst | 54 ++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 contributing/development/configuring_an_ide/img/vscode_edit_configurations.webp diff --git a/contributing/development/configuring_an_ide/img/vscode_edit_configurations.webp b/contributing/development/configuring_an_ide/img/vscode_edit_configurations.webp new file mode 100644 index 0000000000000000000000000000000000000000..ba64ba19970ba7a2576962a7ae8db7b0f28a9152 GIT binary patch literal 3544 zcmV;}4JYzaNk&G{4FCXFMM6+kP&iD)4FCWy^nx4!^;m!YUzOwL&nUcXm>F*I6~AI; z=7yQe+=iLiQkj`yrE&RHq?P=t%$9E?c_sj+qP}hc025UA|2@jGOX=UY}-!%Wzn`3w9$DD$xDd6K^{CX)A{$H zdrepa-0H9ztO_$%ft6uwB|uvdrk%C|O!MumX{e2&jg9?p=FD@f>z-hbAjnQI+XlY{ z9!yNQbLbJhwmc|X4$QStP|-{DK;6Ubgyj({AXY>eaf@U6q37rpFNatPu{dHegaNm+ z@AxPE&~xfGd`HQc+a1Gajnch(tZoMVCqB#4efZCkQMZ4_^g7&|^*iu~&o=9vJ$#Px zZyGKcb{n2)>^b4b<)L@}U0}^$`WGI_+^VG3WZSGxU1mL6_}>#uwpC~8a&Bt2?Ocho zeu@+s_?iC{0lWpGG<`LE1~!ABcsRTd!l-@DpkXE;k;WLX!B4=`A&~oh0GuClruI%~ z7jR)14l2t1VHknaUyi~se_&DD|V(J7`deLMH~38K>MI4*H}` zm@UHo4OsCOs9~oW)fKf7KcS)5x5&n6~I(u*cpVZD@qMJ?Q?KBV&a`NP1B#M zjXD1l;Xau2{|v$hbN=7{{LFuTDl5w@YF3@}^hAIsB!g||pKv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{HiNfK8S3t4xsB#E%9h<%)Q z^h9PiPd;LHGWnfLl6=teoBeN+G%IgU`sx&ptX%v=;VI3*Zw} z>U!;23{XHr;EWxnbl#3++YVPap1f^w_>yI8JyEmQg2`nzP=5FrUKGpoy);AnpTlC| zi*9;DU?KeDm1zLXRNSy^347}NWUxG1?~)Yf)0cJr$=NA`X8B+G3b9zP{y49 z;n<(~&yP8>$;Ah*p*U(W38Cuk*$@=8RyVR3&l?JB-P2#b4URXCdVg4DY_T9=V0aSf z^VAnfnRPM{hS-sZGV7CzMF{HEp|Te_zQ~ye&OU1>s)a8ik4h{?_nx&~s;VEa?YTwL zM)Yrrr$2k(+$LA`1;t{tWInK){U@q7z#1>Z#i2?)8<$R?K_D3pMa`4P-1JZ~D6bEt;m{0GjDp<1Q0%x0gfP<^UI zJ^e*DDL8q`hi1W&S>Jz=p<8Ah^#MC6zr(z5H~UXGeVmLrk`ngRK<~^4lo+O@3Xp6> zh%pq4V(59*Y5)npt!M{2o;Z*Xz+fI6&S8j==`cSMj)Q8P8zuIvuK@)zsRLO)WY&R* z+D-G5YMAM_VPgOj({F=BPzh7@PM&@n1WoOY2mebY%nF6^VH|{sJzsd0ci>pfC!OCgiDo?N>``FX(54!=sFv`BHy z{GUDRf<#BR;0{~bb^{PK`i=}N`WfQ*0kTL0f18kRU6EOz1gDs%RCCl*kDD=s`;2@; z{p2{9D(W@1I2K5qb0gAL5vh=>Xu|Xnwaf<~Pm*J)GaR70QWdy5CUNqBwA0lYv$#@A zZyYy#uMZ4h!?G&H{nsBlVU++&X_kZIMN|#b1R|--9kz2?;#UYj8i~Ph)C8rXf|J8= z`uXUv7I=~4g;NZ5^8-!b#;Aa>cgo(YLiI)`wjGmDEtMFgmL13deCG##<@KA0PAyJfoBFNOh<^5PNz literal 0 HcmV?d00001 diff --git a/contributing/development/configuring_an_ide/visual_studio_code.rst b/contributing/development/configuring_an_ide/visual_studio_code.rst index 77d1cd52b..102363e37 100644 --- a/contributing/development/configuring_an_ide/visual_studio_code.rst +++ b/contributing/development/configuring_an_ide/visual_studio_code.rst @@ -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 ``target=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 `__.