1*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode: 2*61c4878aSAndroid Build Coastguard Worker 3*61c4878aSAndroid Build Coastguard Worker================== 4*61c4878aSAndroid Build Coastguard WorkerVisual Studio Code 5*61c4878aSAndroid Build Coastguard Worker================== 6*61c4878aSAndroid Build Coastguard Worker.. pigweed-module-subpage:: 7*61c4878aSAndroid Build Coastguard Worker :name: pw_ide 8*61c4878aSAndroid Build Coastguard Worker 9*61c4878aSAndroid Build Coastguard Worker.. toctree:: 10*61c4878aSAndroid Build Coastguard Worker :maxdepth: 1 11*61c4878aSAndroid Build Coastguard Worker :hidden: 12*61c4878aSAndroid Build Coastguard Worker 13*61c4878aSAndroid Build Coastguard Worker code_intelligence 14*61c4878aSAndroid Build Coastguard Worker extension_enforcement 15*61c4878aSAndroid Build Coastguard Worker troubleshooting 16*61c4878aSAndroid Build Coastguard Worker legacy 17*61c4878aSAndroid Build Coastguard Worker development 18*61c4878aSAndroid Build Coastguard Worker 19*61c4878aSAndroid Build Coastguard WorkerPigweed provides rich and robust support for development in `Visual Studio Code <https://code.visualstudio.com/>`_, 20*61c4878aSAndroid Build Coastguard Workerincluding: 21*61c4878aSAndroid Build Coastguard Worker 22*61c4878aSAndroid Build Coastguard Worker* High-quality C/C++ code intelligence for embedded systems projects using `clangd <https://clangd.llvm.org/>`_ 23*61c4878aSAndroid Build Coastguard Worker integrated directly with your project's Bazel build graph 24*61c4878aSAndroid Build Coastguard Worker 25*61c4878aSAndroid Build Coastguard Worker* Bundled core Bazel tools, letting you get started immediately without the need 26*61c4878aSAndroid Build Coastguard Worker to install global system dependencies 27*61c4878aSAndroid Build Coastguard Worker 28*61c4878aSAndroid Build Coastguard Worker* Interactive browsing, building, and running Bazel targets 29*61c4878aSAndroid Build Coastguard Worker 30*61c4878aSAndroid Build Coastguard Worker.. note:: 31*61c4878aSAndroid Build Coastguard Worker 32*61c4878aSAndroid Build Coastguard Worker Currently, this document only applies to :ref:`Bazel projects<module-pw_ide-design-projects-bazel>`. 33*61c4878aSAndroid Build Coastguard Worker We're working on adding support for :ref:`bootstrap projects<module-pw_ide-design-projects-bootstrap>`. 34*61c4878aSAndroid Build Coastguard Worker In the meantime, bootstrap projects can use the :ref:`command-line interface<module-pw_ide-guide-cli>` 35*61c4878aSAndroid Build Coastguard Worker with the :ref:`legacy support for Visual Studio Code<module-pw_ide-guide-vscode-legacy>`. 36*61c4878aSAndroid Build Coastguard Worker 37*61c4878aSAndroid Build Coastguard Worker--------------- 38*61c4878aSAndroid Build Coastguard WorkerGetting started 39*61c4878aSAndroid Build Coastguard Worker--------------- 40*61c4878aSAndroid Build Coastguard Worker.. _Pigweed extension: https://marketplace.visualstudio.com/items?itemName=pigweed.pigweed 41*61c4878aSAndroid Build Coastguard Worker 42*61c4878aSAndroid Build Coastguard WorkerAll you need to do is install the `Pigweed extension`_ from the extension 43*61c4878aSAndroid Build Coastguard Workermarketplace. If you start your project from one of Pigweed's quickstart or 44*61c4878aSAndroid Build Coastguard Workershowcase example projects, you will be prompted to install the extension as soon 45*61c4878aSAndroid Build Coastguard Workeras you open the project. 46*61c4878aSAndroid Build Coastguard Worker 47*61c4878aSAndroid Build Coastguard WorkerOnce installed, the Pigweed extension will do a few things for you automatically 48*61c4878aSAndroid Build Coastguard Workerwhen you open :ref:`Pigweed projects<module-pw_ide-design-projects>`: 49*61c4878aSAndroid Build Coastguard Worker 50*61c4878aSAndroid Build Coastguard Worker* The Bazel extension will discover all of the targets in your project 51*61c4878aSAndroid Build Coastguard Worker 52*61c4878aSAndroid Build Coastguard Worker* The Pigweed extension will generate `compilation databases <https://clangd.llvm.org/design/compile-commands>`_ 53*61c4878aSAndroid Build Coastguard Worker for the :ref:`target groups<module-pw_ide-design-cpp-target-groups>` 54*61c4878aSAndroid Build Coastguard Worker in your project. 55*61c4878aSAndroid Build Coastguard Worker 56*61c4878aSAndroid Build Coastguard WorkerYou can now select a target group from the status bar item at the bottom 57*61c4878aSAndroid Build Coastguard Workerof your window or by running the ``Pigweed: Select Code Analysis Target`` 58*61c4878aSAndroid Build Coastguard Workercommand. 59*61c4878aSAndroid Build Coastguard Worker 60*61c4878aSAndroid Build Coastguard WorkerOnce you select a target group, the ``clangd`` extension will be automatically 61*61c4878aSAndroid Build Coastguard Workerconfigured to use the ``clang`` toolchain in the Bazel environment and the 62*61c4878aSAndroid Build Coastguard Workercompilation database associated with the selected target group. 63*61c4878aSAndroid Build Coastguard Worker 64*61c4878aSAndroid Build Coastguard WorkerWhat this gives you 65*61c4878aSAndroid Build Coastguard Worker=================== 66*61c4878aSAndroid Build Coastguard WorkerHere's a non-exhaustive list of cool features you can now enjoy: 67*61c4878aSAndroid Build Coastguard Worker 68*61c4878aSAndroid Build Coastguard Worker* Code navigation, including routing through facades to the correct backend 69*61c4878aSAndroid Build Coastguard Worker 70*61c4878aSAndroid Build Coastguard Worker* Code completion, including correct class members and function signatures 71*61c4878aSAndroid Build Coastguard Worker 72*61c4878aSAndroid Build Coastguard Worker* Tooltips with docs, inferred types for ``auto``, inferred values for ``constexpr``, 73*61c4878aSAndroid Build Coastguard Worker data type sizes, etc. 74*61c4878aSAndroid Build Coastguard Worker 75*61c4878aSAndroid Build Coastguard Worker* Compiler errors and warnings as you write your code 76*61c4878aSAndroid Build Coastguard Worker 77*61c4878aSAndroid Build Coastguard Worker* Code formatting via the standard ``Format ...`` commands, including 78*61c4878aSAndroid Build Coastguard Worker Starlark files 79*61c4878aSAndroid Build Coastguard Worker 80*61c4878aSAndroid Build Coastguard Worker* Linting and debugging for Starlark files 81*61c4878aSAndroid Build Coastguard Worker 82*61c4878aSAndroid Build Coastguard Worker* A tree view of all Bazel targets, allowing you to build or run them directly 83*61c4878aSAndroid Build Coastguard Worker 84*61c4878aSAndroid Build Coastguard Worker----------------- 85*61c4878aSAndroid Build Coastguard WorkerCode intelligence 86*61c4878aSAndroid Build Coastguard Worker----------------- 87*61c4878aSAndroid Build Coastguard WorkerLearn more about using and configuring code intelligence :ref:`here<module-pw_ide-guide-vscode-code-intelligence>`. 88*61c4878aSAndroid Build Coastguard Worker 89*61c4878aSAndroid Build Coastguard Worker---------------- 90*61c4878aSAndroid Build Coastguard WorkerProject settings 91*61c4878aSAndroid Build Coastguard Worker---------------- 92*61c4878aSAndroid Build Coastguard WorkerPigweed manipulates some editor and ``clangd`` settings to support features like 93*61c4878aSAndroid Build Coastguard Workerthe ones described above. For example, when you select a code analysis target, 94*61c4878aSAndroid Build Coastguard WorkerPigweed sets the ``clangd`` extensions settings in ``.vscode/settings.json`` to 95*61c4878aSAndroid Build Coastguard Workerconfigure ``clangd`` to use the selected target. Likewise, when using the 96*61c4878aSAndroid Build Coastguard Worker:ref:`feature to disable code intelligence for source files not in the target's build graph<module-pw_ide-guide-vscode-settings-disable-inactive-file-code-intelligence>`, 97*61c4878aSAndroid Build Coastguard WorkerPigweed will manipulate the ``.clangd`` `configuration file <https://clangd.llvm.org/config#files>`_. 98*61c4878aSAndroid Build Coastguard Worker 99*61c4878aSAndroid Build Coastguard WorkerThese files shouldn't be committed to the project repository, because they 100*61c4878aSAndroid Build Coastguard Workercontain state that is specific to what an individual developer is working on. 101*61c4878aSAndroid Build Coastguard WorkerNonetheless, most projects will want to commit certain shared settings to their 102*61c4878aSAndroid Build Coastguard Workerrepository to help create a more consistent development environment. 103*61c4878aSAndroid Build Coastguard Worker 104*61c4878aSAndroid Build Coastguard WorkerPigweed provides a mechanism to achieve that through additional settings files. 105*61c4878aSAndroid Build Coastguard Worker 106*61c4878aSAndroid Build Coastguard WorkerVisual Studio Code settings 107*61c4878aSAndroid Build Coastguard Worker=========================== 108*61c4878aSAndroid Build Coastguard WorkerThe ``.vscode/settings.json`` file should be excluded from source control. 109*61c4878aSAndroid Build Coastguard WorkerInstead, add your shared project settings to ``.vscode/settings.shared.json`` 110*61c4878aSAndroid Build Coastguard Workerand commit *that* file to source control. 111*61c4878aSAndroid Build Coastguard Worker 112*61c4878aSAndroid Build Coastguard WorkerThe Pigweed extension watches the shared settings file and automatically applies 113*61c4878aSAndroid Build Coastguard Workerthose settings to you local settings file. So shared project settings can be 114*61c4878aSAndroid Build Coastguard Workercommitted to ``.vscode/settings.shared.json``, and your current editor state, as 115*61c4878aSAndroid Build Coastguard Workerwell as your personal configuration preferences, can be stored in 116*61c4878aSAndroid Build Coastguard Worker``.vscode/settings.json``. 117*61c4878aSAndroid Build Coastguard Worker 118*61c4878aSAndroid Build Coastguard WorkerThe automatic sync process will respect any settings you have in your personal 119*61c4878aSAndroid Build Coastguard Workersettings file. In other words, if a conflicting setting appears in the shared 120*61c4878aSAndroid Build Coastguard Workersettings file, the automatic sync will not override your personal setting. 121*61c4878aSAndroid Build Coastguard Worker 122*61c4878aSAndroid Build Coastguard WorkerAt some point, you may wish to *fully* synchronize with the shared settings, 123*61c4878aSAndroid Build Coastguard Workeroverriding any conflicting settings you may already have in your personal 124*61c4878aSAndroid Build Coastguard Workersettings file. You can accomplish that by running the 125*61c4878aSAndroid Build Coastguard Worker:ref:`settings sync command<module-pw_ide-guide-vscode-commands-sync-settings>`. 126*61c4878aSAndroid Build Coastguard Worker 127*61c4878aSAndroid Build Coastguard Worker``clangd`` settings 128*61c4878aSAndroid Build Coastguard Worker=================== 129*61c4878aSAndroid Build Coastguard WorkerAdditional configuration for ``clangd`` can be stored in ``.clangd.shared``, 130*61c4878aSAndroid Build Coastguard Workerfollowing the `YAML configuration format <https://clangd.llvm.org/config>`_. 131*61c4878aSAndroid Build Coastguard WorkerThe Pigweed extension watches this file and automatically applies its settings 132*61c4878aSAndroid Build Coastguard Workerto a ``.clangd`` file that *should not* be committed to source control. That 133*61c4878aSAndroid Build Coastguard Workerfile will *also* be used to configure ``clangd`` in ways that are specific to 134*61c4878aSAndroid Build Coastguard Workeryour selected analysis target and the state of your code tree. 135*61c4878aSAndroid Build Coastguard Worker 136*61c4878aSAndroid Build Coastguard Worker-------- 137*61c4878aSAndroid Build Coastguard WorkerCommands 138*61c4878aSAndroid Build Coastguard Worker-------- 139*61c4878aSAndroid Build Coastguard WorkerAccess commands by opening the command palette :kbd:`Ctrl+Shift+P` 140*61c4878aSAndroid Build Coastguard Worker(:kbd:`Cmd+Shift+P` on Mac). 141*61c4878aSAndroid Build Coastguard Worker 142*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Check Extensions 143*61c4878aSAndroid Build Coastguard Worker 144*61c4878aSAndroid Build Coastguard Worker The Pigweed extension lets development teams maintain a consistent 145*61c4878aSAndroid Build Coastguard Worker development environment for all members of the team by ensuring that the 146*61c4878aSAndroid Build Coastguard Worker recommendations in ``extensions.json`` are enforced. Learn more at 147*61c4878aSAndroid Build Coastguard Worker :ref:`extension enforcement<module-pw_ide-guide-vscode-extension-enforcement>`. 148*61c4878aSAndroid Build Coastguard Worker 149*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: File Bug 150*61c4878aSAndroid Build Coastguard Worker 151*61c4878aSAndroid Build Coastguard Worker Found a problem in the Pigweed Visual Studio Code extension, other Pigweed 152*61c4878aSAndroid Build Coastguard Worker tools, or Pigweed itself? Add a bug to our bug tracker to help us fix it. 153*61c4878aSAndroid Build Coastguard Worker 154*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-commands-sync-settings: 155*61c4878aSAndroid Build Coastguard Worker 156*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Sync Settings 157*61c4878aSAndroid Build Coastguard Worker 158*61c4878aSAndroid Build Coastguard Worker Pigweed automatically syncronizes shared Visual Studio Code settings from 159*61c4878aSAndroid Build Coastguard Worker ``.vscode/settings.shared.json`` to ``.vscode/settings.json``, but in the 160*61c4878aSAndroid Build Coastguard Worker case of conflicts, the automatic process will preserve the value in 161*61c4878aSAndroid Build Coastguard Worker ``.vscode/settings.json``. If you want to do a full sync of the shared 162*61c4878aSAndroid Build Coastguard Worker settings to your personal settings, including overriding conflicting values, 163*61c4878aSAndroid Build Coastguard Worker run this command. 164*61c4878aSAndroid Build Coastguard Worker 165*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-commands-open-output-panel: 166*61c4878aSAndroid Build Coastguard Worker 167*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Open Output Panel 168*61c4878aSAndroid Build Coastguard Worker 169*61c4878aSAndroid Build Coastguard Worker Opens the Pigweed output panel, which contains diagnostic output generated by 170*61c4878aSAndroid Build Coastguard Worker the Pigweed extension. This is a good first place to look if things go wrong. 171*61c4878aSAndroid Build Coastguard Worker 172*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-commands-refresh-compile-commands: 173*61c4878aSAndroid Build Coastguard Worker 174*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Refresh Compile Commands 175*61c4878aSAndroid Build Coastguard Worker 176*61c4878aSAndroid Build Coastguard Worker Manually trigger a refresh of the compilation databases used for C/C++ code 177*61c4878aSAndroid Build Coastguard Worker intelligence. Normally, the databases are refreshed automatically when build 178*61c4878aSAndroid Build Coastguard Worker files are changed, but if you have 179*61c4878aSAndroid Build Coastguard Worker :ref:`automatic refreshing disabled<module-pw_ide-guide-vscode-settings-disable-compile-commands-file-watcher>` 180*61c4878aSAndroid Build Coastguard Worker or need to refresh outside of the automatic cycle, this command will refresh 181*61c4878aSAndroid Build Coastguard Worker manually. 182*61c4878aSAndroid Build Coastguard Worker 183*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Refresh Compile Commands and Set Code Analysis Target 184*61c4878aSAndroid Build Coastguard Worker 185*61c4878aSAndroid Build Coastguard Worker This is the same as the :ref:`Pigweed: Refresh Compile Commands<module-pw_ide-guide-vscode-commands-refresh-compile-commands>`, 186*61c4878aSAndroid Build Coastguard Worker except that it also triggers :ref:`Pigweed: Select Code Analysis Target<module-pw_ide-guide-vscode-commands-select-target>` 187*61c4878aSAndroid Build Coastguard Worker after the refresh is complete. 188*61c4878aSAndroid Build Coastguard Worker 189*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-commands-select-target: 190*61c4878aSAndroid Build Coastguard Worker 191*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Select Code Analysis Target 192*61c4878aSAndroid Build Coastguard Worker 193*61c4878aSAndroid Build Coastguard Worker Select the target group that ``clangd`` should use for code analysis. 194*61c4878aSAndroid Build Coastguard Worker 195*61c4878aSAndroid Build Coastguard Worker .. tip:: 196*61c4878aSAndroid Build Coastguard Worker 197*61c4878aSAndroid Build Coastguard Worker You might notice that the currently-selected code analysis target is 198*61c4878aSAndroid Build Coastguard Worker stored in the ``pigweed.codeAnalysisTarget`` setting. If you edit this 199*61c4878aSAndroid Build Coastguard Worker value manually, don't worry! The Pigweed extension will immediately do 200*61c4878aSAndroid Build Coastguard Worker everything it would have done if you had run this command. 201*61c4878aSAndroid Build Coastguard Worker 202*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Disable Inactive File Code Intelligence 203*61c4878aSAndroid Build Coastguard Worker 204*61c4878aSAndroid Build Coastguard Worker See :ref:`the associated setting<module-pw_ide-guide-vscode-settings-disable-inactive-file-code-intelligence>`. 205*61c4878aSAndroid Build Coastguard Worker 206*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Enable Inactive File Code Intelligence 207*61c4878aSAndroid Build Coastguard Worker 208*61c4878aSAndroid Build Coastguard Worker See :ref:`the associated setting<module-pw_ide-guide-vscode-settings-disable-inactive-file-code-intelligence>`. 209*61c4878aSAndroid Build Coastguard Worker 210*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Set Bazel Recommended Settings 211*61c4878aSAndroid Build Coastguard Worker 212*61c4878aSAndroid Build Coastguard Worker Configure Visual Studio Code to use Pigweed's recommended Bazel settings. 213*61c4878aSAndroid Build Coastguard Worker Note that these settings are only applied to the *project* settings, so they 214*61c4878aSAndroid Build Coastguard Worker don't affect any other project's settings, or your user settings. 215*61c4878aSAndroid Build Coastguard Worker 216*61c4878aSAndroid Build Coastguard Worker * Sets the Buildifier path to the version bundled with the Pigweed extension, enabling Starlark code intelligence 217*61c4878aSAndroid Build Coastguard Worker 218*61c4878aSAndroid Build Coastguard Worker * Enables Bazel CodeLens support, allowing you to build and run targets directly from Bazel files 219*61c4878aSAndroid Build Coastguard Worker 220*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Set Bazelisk Path 221*61c4878aSAndroid Build Coastguard Worker 222*61c4878aSAndroid Build Coastguard Worker Pigweed recommends using `Bazelisk <https://github.com/bazelbuild/bazelisk>`_ 223*61c4878aSAndroid Build Coastguard Worker instead of plain Bazel to ensure that the right version of Bazel is used. 224*61c4878aSAndroid Build Coastguard Worker This command allows you to set the path to Bazelisk, selecting from versions 225*61c4878aSAndroid Build Coastguard Worker installed on your system or the version bundled with the Pigweed extension. 226*61c4878aSAndroid Build Coastguard Worker 227*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Activate Bazelisk in Terminal 228*61c4878aSAndroid Build Coastguard Worker 229*61c4878aSAndroid Build Coastguard Worker This will change the `$PATH` of your active integrated terminal to include 230*61c4878aSAndroid Build Coastguard Worker the path to Bazelisk configured in your editor settings. This allows you to 231*61c4878aSAndroid Build Coastguard Worker run Bazel actions via Visual Studio Code commands or via `bazelisk ...` 232*61c4878aSAndroid Build Coastguard Worker invocations in the integrated terminal, while working in the same Bazel 233*61c4878aSAndroid Build Coastguard Worker environment. 234*61c4878aSAndroid Build Coastguard Worker 235*61c4878aSAndroid Build Coastguard Worker--------------------- 236*61c4878aSAndroid Build Coastguard WorkerConfiguration options 237*61c4878aSAndroid Build Coastguard Worker--------------------- 238*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.activateBazeliskInNewTerminals 239*61c4878aSAndroid Build Coastguard Worker :type: boolean 240*61c4878aSAndroid Build Coastguard Worker :value: true 241*61c4878aSAndroid Build Coastguard Worker 242*61c4878aSAndroid Build Coastguard Worker When enabled, the path to Bazelisk will be added to the integrated terminal when launched 243*61c4878aSAndroid Build Coastguard Worker 244*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.codeAnalysisTarget 245*61c4878aSAndroid Build Coastguard Worker :type: string 246*61c4878aSAndroid Build Coastguard Worker 247*61c4878aSAndroid Build Coastguard Worker The build target to use for editor code intelligence 248*61c4878aSAndroid Build Coastguard Worker 249*61c4878aSAndroid Build Coastguard Worker.. warning:: 250*61c4878aSAndroid Build Coastguard Worker 251*61c4878aSAndroid Build Coastguard Worker You should only set this value by running the :ref:`Pigweed\: Select Code Analysis Target<module-pw_ide-guide-vscode-commands-select-target>`. 252*61c4878aSAndroid Build Coastguard Worker The command has other configuration side-effects that won't be triggered if 253*61c4878aSAndroid Build Coastguard Worker you manually set the value in ``settings.json``. 254*61c4878aSAndroid Build Coastguard Worker 255*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.disableBazelSettingsRecommendation 256*61c4878aSAndroid Build Coastguard Worker :type: boolean 257*61c4878aSAndroid Build Coastguard Worker :value: false 258*61c4878aSAndroid Build Coastguard Worker 259*61c4878aSAndroid Build Coastguard Worker Disable reminders to use Pigweed's Bazel settings recommendations 260*61c4878aSAndroid Build Coastguard Worker 261*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.disableBazeliskCheck 262*61c4878aSAndroid Build Coastguard Worker :type: boolean 263*61c4878aSAndroid Build Coastguard Worker :value: false 264*61c4878aSAndroid Build Coastguard Worker 265*61c4878aSAndroid Build Coastguard Worker Disable the recommendation to use Bazelisk 266*61c4878aSAndroid Build Coastguard Worker 267*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-disable-compile-commands-file-watcher: 268*61c4878aSAndroid Build Coastguard Worker 269*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.disableCompileCommandsFileWatcher 270*61c4878aSAndroid Build Coastguard Worker :type: boolean 271*61c4878aSAndroid Build Coastguard Worker :value: false 272*61c4878aSAndroid Build Coastguard Worker 273*61c4878aSAndroid Build Coastguard Worker Disable automatically refreshing compile commands 274*61c4878aSAndroid Build Coastguard Worker 275*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-disable-inactive-file-code-intelligence: 276*61c4878aSAndroid Build Coastguard Worker 277*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.disableInactiveFileCodeIntelligence 278*61c4878aSAndroid Build Coastguard Worker :type: boolean 279*61c4878aSAndroid Build Coastguard Worker :value: true 280*61c4878aSAndroid Build Coastguard Worker 281*61c4878aSAndroid Build Coastguard Worker When you select a target for code analysis, some source files in the project 282*61c4878aSAndroid Build Coastguard Worker may not appear in the compilation database for that target because they are 283*61c4878aSAndroid Build Coastguard Worker not part of the build graph for the target. By default, ``clangd`` will 284*61c4878aSAndroid Build Coastguard Worker attempt to provide code intelligence for those files anyway by inferring 285*61c4878aSAndroid Build Coastguard Worker compile commands from similar files in the build graph, but this code 286*61c4878aSAndroid Build Coastguard Worker intelligence is incorrect and meaningless, as the file won't actually be 287*61c4878aSAndroid Build Coastguard Worker compiled for that target. 288*61c4878aSAndroid Build Coastguard Worker 289*61c4878aSAndroid Build Coastguard Worker Enabling this option will configure ``clangd`` to suppress all diagnostics 290*61c4878aSAndroid Build Coastguard Worker for any source files that are *not* part of the build graph for the currently 291*61c4878aSAndroid Build Coastguard Worker selected target. 292*61c4878aSAndroid Build Coastguard Worker 293*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-enforce-extension-recommendations: 294*61c4878aSAndroid Build Coastguard Worker 295*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.enforceExtensionRecommendations 296*61c4878aSAndroid Build Coastguard Worker :type: boolean 297*61c4878aSAndroid Build Coastguard Worker :value: false 298*61c4878aSAndroid Build Coastguard Worker 299*61c4878aSAndroid Build Coastguard Worker Require installing and disabling extensions recommended in ``extensions.json`` 300*61c4878aSAndroid Build Coastguard Worker 301*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-hide-inactive-file-indicators: 302*61c4878aSAndroid Build Coastguard Worker 303*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.hideInactiveFileIndicators 304*61c4878aSAndroid Build Coastguard Worker :type: boolean 305*61c4878aSAndroid Build Coastguard Worker :value: false 306*61c4878aSAndroid Build Coastguard Worker 307*61c4878aSAndroid Build Coastguard Worker When code intelligence is enabled for all files, hide indicators for inactive 308*61c4878aSAndroid Build Coastguard Worker and orphaned files. Note that changing this setting requires you to reload 309*61c4878aSAndroid Build Coastguard Worker Visual Studio Code to take effect. 310*61c4878aSAndroid Build Coastguard Worker 311*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.preserveBazelPath 312*61c4878aSAndroid Build Coastguard Worker :type: boolean 313*61c4878aSAndroid Build Coastguard Worker :value: false 314*61c4878aSAndroid Build Coastguard Worker 315*61c4878aSAndroid Build Coastguard Worker When enabled, this extension won't override the specified Bazel path under 316*61c4878aSAndroid Build Coastguard Worker any circumstances. 317*61c4878aSAndroid Build Coastguard Worker 318*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-project-root: 319*61c4878aSAndroid Build Coastguard Worker 320*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.projectRoot 321*61c4878aSAndroid Build Coastguard Worker :type: string 322*61c4878aSAndroid Build Coastguard Worker 323*61c4878aSAndroid Build Coastguard Worker The root of the Pigweed project source directory 324*61c4878aSAndroid Build Coastguard Worker 325*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-project-type: 326*61c4878aSAndroid Build Coastguard Worker 327*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.projectType 328*61c4878aSAndroid Build Coastguard Worker :type: bootstrap or bazel 329*61c4878aSAndroid Build Coastguard Worker 330*61c4878aSAndroid Build Coastguard Worker The type of Pigweed project, either bootstrap or Bazel 331*61c4878aSAndroid Build Coastguard Worker 332*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-settings-refresh-compile-commands-target: 333*61c4878aSAndroid Build Coastguard Worker 334*61c4878aSAndroid Build Coastguard Worker.. py:data:: pigweed.refreshCompileCommandsTarget 335*61c4878aSAndroid Build Coastguard Worker :type: string 336*61c4878aSAndroid Build Coastguard Worker :value: //:refresh_compile_commands 337*61c4878aSAndroid Build Coastguard Worker 338*61c4878aSAndroid Build Coastguard Worker The Bazel target to run to refresh compile commands 339