xref: /aosp_15_r20/external/pigweed/pw_ide/guide/vscode/extension_enforcement.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1.. _module-pw_ide-guide-vscode-extension-enforcement:
2
3=====================
4Extension enforcement
5=====================
6.. pigweed-module-subpage::
7   :name: pw_ide
8
9One of Pigweed's most powerful benefits is that it provides all developers on
10a project team with a consistent development environment. Some teams want to
11extend this consistency to the IDE by declaring that a certain set of extensions
12should be enabled (or disabled) when working on their project.
13
14Visual Studio Code provides two mechanisms for indicating that users *should*
15have certain extensions:
16
17#. Extensions can have other extensions as dependencies, such that installing
18   the extension also installs its dependencies.
19
20#. Projects can included *recommendations* in ``.vscode/extensions.json``.
21
22The problem with the first option is that it is only available to extensions.
23Projects can't declare extension dependencies.
24
25The problem with the second option is that they are just *recommendations*, and
26there is no built-in mechanism to enforce them or even install them by default.
27
28Because there's not a natural way to achieve the goal of editor consistency
29natively in Visual Studio Code, the Pigweed extension provides an additional
30mechanism that teams can use instead.
31
32-----
33Usage
34-----
35Just enable :ref:`the setting<module-pw_ide-guide-vscode-settings-enforce-extension-recommendations>`.
36
37Now, extensions listed under ``recommendations`` in the project's
38``.vscode/extensions.json`` will need to be installed and enabled for the
39project, and the user will be prompted to do so until all of the extensions are
40installed and enabled, or until the user manually disables the notification.
41
42.. tip::
43
44   Although installed extensions are available globally, they don't need to be
45   enabled in other projects or instances of Visual Studio Code.
46
47Likewise, extensions listed under ``unwantedRecommendations`` will need to be
48uninstalled or disabled, and the user will be prompted to do so until all of the
49extensions are installed and enabled, or until the user manually disables the
50notification.
51
52.. tip::
53
54   Unwanted recommendations don't need to be uninstalled if you use them in
55   other projects. Just disable them for this project.
56