VSCode should be blocked from adding headers (perhaps by component)
Categories
(Developer Infrastructure :: Developer Environment Integration, enhancement)
Tracking
(firefox119 fixed)
| Tracking | Status | |
|---|---|---|
| firefox119 | --- | fixed |
People
(Reporter: mgaudet, Assigned: mgaudet)
Details
Attachments
(1 external file)
Somehow (and I cannot find a preference to disable this) VSCode tries to be helpful by adding header includes to files.
The problem is, it does it wrong, frequently not including the correct stem, or putting it in a terrible position, causing build errors -- or worse, silently making a patch worse requiring you to notice the diff before submission.
In our VSCode setup, we should either block this from happening (perhaps by component; I know SpiderMonkey is more persnickity about its headers than other compnents), or fix the header includes to do the right thing
(I'd accept a pointer to the setting where I can turn this off personally, but I have at least one colleague who is also affected by this)
| Assignee | ||
Comment 1•3 years ago
|
||
I -think- the following diff accomplishes what I want, at least globally. While I'd prefer this be per directory, I think this helps stop all the craziness...
diff --git a/python/mozbuild/mozbuild/backend/mach_commands.py b/python/mozbuild/mozbuild/backend/mach_commands.py
--- a/python/mozbuild/mozbuild/backend/mach_commands.py
+++ b/python/mozbuild/mozbuild/backend/mach_commands.py
@@ -355,6 +355,7 @@ def setup_clangd_rust_in_vscode(command_
"--pch-storage",
"disk",
"--clang-tidy",
+ "--header-insertion=never"
],
"rust-analyzer.server.extraEnv": {
# Point rust-analyzer at the real target directory used by our
| Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:mgaudet, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 4•3 years ago
|
||
Whoops. Was on vacation when this was approved and cleared it out of my email without noticing. Landing now.
Comment 6•3 years ago
|
||
| bugherder | ||
Description
•