In command lines with /showIncludes, clangd would output includes to stdout, breaking clients.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks!
| clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp | ||
|---|---|---|
| 82 | It's useful to have this test to verify the behavior at the clangd level, but the arg adjuster is a separate library and also used in other contexts. The unit-test for this arg-adjuster lives in clang/unittests/Tooling/ToolingTest.cpp around line 500. Could you add a test for the new behavior there, too? | |
| clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp | ||
|---|---|---|
| 82 | Done. | |
| clang/lib/Tooling/ArgumentsAdjusters.cpp | ||
|---|---|---|
| 101 | this can also be --show-includes | |
| clang/lib/Tooling/ArgumentsAdjusters.cpp | ||
|---|---|---|
| 101 | and looks like there's also /showIncludes:user :/ | |
| clang/lib/Tooling/ArgumentsAdjusters.cpp | ||
|---|---|---|
| 101 | Handled /showIncludes:user, thanks for catching that. I don't see --show-includes though, clang-cl and clang both don't like the option? | |
thanks, lgtm. do you have commit access?
| clang/lib/Tooling/ArgumentsAdjusters.cpp | ||
|---|---|---|
| 101 | ah sorry, that one is a frontend option rather than a driver one. so nvm that one. | |
| clang/lib/Tooling/ArgumentsAdjusters.cpp | ||
|---|---|---|
| 101 | clang-cl suports both /foo and -foo style flags. See the top of clang/include/clang/Driver/CLCompatOptions.td You probably want to add the -showIncludes prefix here too. Ideally this probably wouldn't do its own commandline parsing here (?) | |
It's useful to have this test to verify the behavior at the clangd level, but the arg adjuster is a separate library and also used in other contexts.
The unit-test for this arg-adjuster lives in clang/unittests/Tooling/ToolingTest.cpp around line 500. Could you add a test for the new behavior there, too?