xref: /aosp_15_r20/external/pigweed/pw_ide/guide/vscode/legacy.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-legacy:
2*61c4878aSAndroid Build Coastguard Worker
3*61c4878aSAndroid Build Coastguard Worker======================
4*61c4878aSAndroid Build Coastguard WorkerLegacy support via CLI
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 WorkerThe :ref:`pw_ide CLI<module-pw_ide-guide-cli>` provides an alternative method
10*61c4878aSAndroid Build Coastguard Workerof configuring Visual Studio Code for :ref:`bootstrap Pigweed projects<module-pw_ide-design-projects-bootstrap>`
11*61c4878aSAndroid Build Coastguard Workerthat doesn't rely on the use of an extension. This page documents that
12*61c4878aSAndroid Build Coastguard Workerfunctionality.
13*61c4878aSAndroid Build Coastguard Worker
14*61c4878aSAndroid Build Coastguard Worker.. tip::
15*61c4878aSAndroid Build Coastguard Worker
16*61c4878aSAndroid Build Coastguard Worker   Are you working on a :ref:`Bazel Pigweed project<module-pw_ide-design-projects-bazel>`?
17*61c4878aSAndroid Build Coastguard Worker   These instructions won't work for you. Use the :ref:`extension<module-pw_ide-guide-vscode>`!
18*61c4878aSAndroid Build Coastguard Worker
19*61c4878aSAndroid Build Coastguard Worker-----
20*61c4878aSAndroid Build Coastguard WorkerUsage
21*61c4878aSAndroid Build Coastguard Worker-----
22*61c4878aSAndroid Build Coastguard WorkerRunning ``pw ide sync`` will automatically generate settings for Visual Studio
23*61c4878aSAndroid Build Coastguard WorkerCode. ``pw_ide`` comes with sensible defaults for Pigweed projects, but those
24*61c4878aSAndroid Build Coastguard Workercan be augmented or overridden at the project level or the user level using
25*61c4878aSAndroid Build Coastguard Worker``pw_project_settings.json`` and ``pw_user_settings.json`` respectively. The
26*61c4878aSAndroid Build Coastguard Workergenerated ``settings.json`` file is essentially a build artifact and shouldn't
27*61c4878aSAndroid Build Coastguard Workerbe committed to source control.
28*61c4878aSAndroid Build Coastguard Worker
29*61c4878aSAndroid Build Coastguard Worker.. note::
30*61c4878aSAndroid Build Coastguard Worker
31*61c4878aSAndroid Build Coastguard Worker   You should treat ``settings.json`` as a build artifact and avoid editing it
32*61c4878aSAndroid Build Coastguard Worker   directly. However, if you do make changes to it, don't worry! The changes
33*61c4878aSAndroid Build Coastguard Worker   will be preserved after running ``pw ide sync`` if they don't conflict with
34*61c4878aSAndroid Build Coastguard Worker   with the settings that command sets.
35*61c4878aSAndroid Build Coastguard Worker
36*61c4878aSAndroid Build Coastguard WorkerThe same pattern applies to ``tasks.json``, which provides Visual Studio Code
37*61c4878aSAndroid Build Coastguard Workertasks for ``pw_ide`` commands. Access these by opening the command palette
38*61c4878aSAndroid Build Coastguard Worker:kbd:`Ctrl+Shift+P` (:kbd:`Cmd+Shift+P` on Mac), selecting ``Tasks: Run Task``,
39*61c4878aSAndroid Build Coastguard Workerthen selecting the desired task.
40*61c4878aSAndroid Build Coastguard Worker
41*61c4878aSAndroid Build Coastguard Worker.. tip::
42*61c4878aSAndroid Build Coastguard Worker
43*61c4878aSAndroid Build Coastguard Worker   The default tasks that ``pw ide sync`` generates can serve as an example of
44*61c4878aSAndroid Build Coastguard Worker   how to launch your own tasks within an activated environment.
45*61c4878aSAndroid Build Coastguard Worker
46*61c4878aSAndroid Build Coastguard WorkerThe same pattern also applies to ``launch.json``, which is used to define
47*61c4878aSAndroid Build Coastguard Workerconfigurations for running and debugging your project. Create a
48*61c4878aSAndroid Build Coastguard Worker``pw_project_launch.json`` with configurations that conform to the Visual Studio
49*61c4878aSAndroid Build Coastguard WorkerCode `debugger configuration format <https://code.visualstudio.com/docs/editor/debugging>`_.
50*61c4878aSAndroid Build Coastguard Worker
51*61c4878aSAndroid Build Coastguard WorkerCommands
52*61c4878aSAndroid Build Coastguard Worker========
53*61c4878aSAndroid Build Coastguard WorkerThese commands are actually `tasks <https://code.visualstudio.com/docs/editor/tasks>`_,
54*61c4878aSAndroid Build Coastguard Workerso you run them by running the ``Tasks: Run Task`` command, then selecting the
55*61c4878aSAndroid Build Coastguard Workertask.
56*61c4878aSAndroid Build Coastguard Worker
57*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Sync IDE
58*61c4878aSAndroid Build Coastguard Worker
59*61c4878aSAndroid Build Coastguard Worker   Runs ``pw ide sync`` without you needing to type it into an activated shell.
60*61c4878aSAndroid Build Coastguard Worker
61*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Set C++ Target Toolchain
62*61c4878aSAndroid Build Coastguard Worker
63*61c4878aSAndroid Build Coastguard Worker   Allows you to select the target toolchain to use for code intelligence from
64*61c4878aSAndroid Build Coastguard Worker   a dropdown list of available options.
65*61c4878aSAndroid Build Coastguard Worker
66*61c4878aSAndroid Build Coastguard Worker.. describe:: Pigweed: Set Python Virtual Environment
67*61c4878aSAndroid Build Coastguard Worker
68*61c4878aSAndroid Build Coastguard Worker   Allows you to provide the path to the Python virtual environment. This is
69*61c4878aSAndroid Build Coastguard Worker   normally configured automatically to use the Pigweed environment's Python,
70*61c4878aSAndroid Build Coastguard Worker   but for unusual project structures, you may need to select another Python
71*61c4878aSAndroid Build Coastguard Worker   environment.
72