[PATCH] D145843: [clangd] Add option to always insert headers with <> instead of ""

Andrew Kaster via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 11 03:46:46 PST 2023


ADKaster created this revision.
Herald added subscribers: kadircet, arphaman.
Herald added a project: All.
ADKaster requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

Projects can now add the following config fragment to their .clangd:

  yaml
  Style:
    AlwaysBracketedInclude: Yes

to force headers inserted via the --header-insertion=iwyu mode to have
<> around them in all cases, rather than relying on whether the header
was included via -isystem or not.

Ref https://github.com/clangd/clangd/issues/1247

This solution does not allow forcing "" in all cases, nor does it affect
other clang tools like clang-format.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145843

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/Config.h
  clang-tools-extra/clangd/ConfigCompile.cpp
  clang-tools-extra/clangd/ConfigFragment.h
  clang-tools-extra/clangd/ConfigYAML.cpp
  clang-tools-extra/clangd/Headers.cpp
  clang-tools-extra/clangd/Headers.h
  clang-tools-extra/clangd/ParsedAST.cpp
  clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp
  clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
  clang-tools-extra/clangd/unittests/HeadersTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145843.504350.patch
Type: text/x-patch
Size: 11171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230311/e01f118c/attachment-0001.bin>


More information about the cfe-commits mailing list