xref: /aosp_15_r20/external/pigweed/pw_ide/guide/vscode/troubleshooting.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker.. _module-pw_ide-guide-vscode-troubleshooting:
2*61c4878aSAndroid Build Coastguard Worker
3*61c4878aSAndroid Build Coastguard Worker===============
4*61c4878aSAndroid Build Coastguard WorkerTroubleshooting
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 WorkerThis doc provides troubleshooting advice specific to the Pigweed Visual Studio
10*61c4878aSAndroid Build Coastguard WorkerCode extension.
11*61c4878aSAndroid Build Coastguard Worker
12*61c4878aSAndroid Build Coastguard Worker.. _project-type:
13*61c4878aSAndroid Build Coastguard Worker
14*61c4878aSAndroid Build Coastguard Worker----------------------------
15*61c4878aSAndroid Build Coastguard WorkerCan't determine project type
16*61c4878aSAndroid Build Coastguard Worker----------------------------
17*61c4878aSAndroid Build Coastguard WorkerThe Pigweed extension wasn't able to infer whether your Pigweed project is a
18*61c4878aSAndroid Build Coastguard Worker:ref:`Bazel project<module-pw_ide-design-projects-bazel>` or a
19*61c4878aSAndroid Build Coastguard Worker:ref:`bootstrap project<module-pw_ide-design-projects-bootstrap>`. This may
20*61c4878aSAndroid Build Coastguard Workerhappen if you have an unusual project structure.
21*61c4878aSAndroid Build Coastguard Worker
22*61c4878aSAndroid Build Coastguard WorkerYou can resolve it by :ref:`explicitly setting the project type<module-pw_ide-guide-vscode-settings-project-type>`
23*61c4878aSAndroid Build Coastguard Workerin your settings.
24*61c4878aSAndroid Build Coastguard Worker
25*61c4878aSAndroid Build Coastguard Worker.. _project-root:
26*61c4878aSAndroid Build Coastguard Worker
27*61c4878aSAndroid Build Coastguard Worker-----------------------
28*61c4878aSAndroid Build Coastguard WorkerCan't find project root
29*61c4878aSAndroid Build Coastguard Worker-----------------------
30*61c4878aSAndroid Build Coastguard WorkerThe Pigweed extension wasn't able to infer the path to your
31*61c4878aSAndroid Build Coastguard Worker:ref:`Pigweed project root<module-pw_ide-design-projects-project-root>`. This
32*61c4878aSAndroid Build Coastguard Workermay happen if you have an unusual project structure.
33*61c4878aSAndroid Build Coastguard Worker
34*61c4878aSAndroid Build Coastguard WorkerYou can resolve it by :ref:`explicitly setting the project root<module-pw_ide-guide-vscode-settings-project-root>`
35*61c4878aSAndroid Build Coastguard Workerin your settings.
36*61c4878aSAndroid Build Coastguard Worker
37*61c4878aSAndroid Build Coastguard Worker.. _failed_to_refresh_code_intelligence:
38*61c4878aSAndroid Build Coastguard Worker
39*61c4878aSAndroid Build Coastguard Worker----------------------------------------
40*61c4878aSAndroid Build Coastguard WorkerFailed to refresh code intelligence data
41*61c4878aSAndroid Build Coastguard Worker----------------------------------------
42*61c4878aSAndroid Build Coastguard WorkerThe Pigweed extension failed to refresh the compilation databases or other data
43*61c4878aSAndroid Build Coastguard Workerused to provide code intelligences. Some troubleshooting steps:
44*61c4878aSAndroid Build Coastguard Worker
45*61c4878aSAndroid Build Coastguard Worker* Check the output panel (``Pigweed: Open Output Panel``) to find more specific
46*61c4878aSAndroid Build Coastguard Worker  information about what went wrong.
47*61c4878aSAndroid Build Coastguard Worker
48*61c4878aSAndroid Build Coastguard Worker* Verify that the Bazel ``refresh_compile_commands`` target is configured
49*61c4878aSAndroid Build Coastguard Worker  properly in the top-level ``//BUILD.bazel`` file. There will be relevant
50*61c4878aSAndroid Build Coastguard Worker  content in the output panel if this is not configured correctly.
51*61c4878aSAndroid Build Coastguard Worker
52*61c4878aSAndroid Build Coastguard Worker.. _bazel_no_targets:
53*61c4878aSAndroid Build Coastguard Worker
54*61c4878aSAndroid Build Coastguard Worker---------------------------------
55*61c4878aSAndroid Build Coastguard WorkerCouldn't find any targets (Bazel)
56*61c4878aSAndroid Build Coastguard Worker---------------------------------
57*61c4878aSAndroid Build Coastguard WorkerThe Pigweed extension couldn't find any Bazel targets or target groups to use
58*61c4878aSAndroid Build Coastguard Workerfor code intelligence. Here are some troubleshooting steps to follow:
59*61c4878aSAndroid Build Coastguard Worker
60*61c4878aSAndroid Build Coastguard WorkerCheck the output panel for errors that may have occurred
61*61c4878aSAndroid Build Coastguard Worker========================================================
62*61c4878aSAndroid Build Coastguard WorkerRun ``Pigweed: Open Output Panel`` from the command palette. You should see the
63*61c4878aSAndroid Build Coastguard Workeroutput from the most recent attempt to generate compile commands. If you *don't*
64*61c4878aSAndroid Build Coastguard Workersee that output, you can manually start the process by running
65*61c4878aSAndroid Build Coastguard Worker``Pigweed: Refresh Compile Commands``.
66*61c4878aSAndroid Build Coastguard Worker
67*61c4878aSAndroid Build Coastguard WorkerThe most common failure here is actually an upstream failure in the Bazel build,
68*61c4878aSAndroid Build Coastguard Workerlike missing dependencies or invalid Starlark files. Resolve those problems,
69*61c4878aSAndroid Build Coastguard Workerand the refresh process should restart automatically.
70*61c4878aSAndroid Build Coastguard Worker
71*61c4878aSAndroid Build Coastguard WorkerConfirm that the ``refresh_compile_commands`` target is correctly defined
72*61c4878aSAndroid Build Coastguard Worker=========================================================================
73*61c4878aSAndroid Build Coastguard WorkerThe top-level ``BUILD.bazel`` file contains a call to
74*61c4878aSAndroid Build Coastguard Worker``refresh_compile_commands`` that defines the refresh process target. Any syntax
75*61c4878aSAndroid Build Coastguard Workeror configuration errors in that call will prevent the refresh process from
76*61c4878aSAndroid Build Coastguard Workerrunning successfully.
77*61c4878aSAndroid Build Coastguard Worker
78*61c4878aSAndroid Build Coastguard WorkerMost importantly, ensure that the ``targets`` or ``target_groups`` attributes
79*61c4878aSAndroid Build Coastguard Workerare defined. Defining both is valid too, but at least one must be present.
80