[PATCH] D33932: [clang-format] Add support for case-insensitive header matching and use it to improve support for LLVM-style include sorting.

2019-05-31 Thread Nikolaus Wittenstein via Phabricator via cfe-commits
adzenith added a comment.

It appears I was mistaken - the `(?-i)` caused the regex match to fail 
entirely, which made the system header move all the way to the end. It didn't 
actually solve my problem.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D33932/new/

https://reviews.llvm.org/D33932



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D33932: [clang-format] Add support for case-insensitive header matching and use it to improve support for LLVM-style include sorting.

2019-05-31 Thread Nikolaus Wittenstein via Phabricator via cfe-commits
adzenith added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I just came across this case-insensitive behavior when trying to regroup 
include blocks and it was surprising. I'm trying to put system headers after 
other angle-bracket includes (like for Qt), and I was trying:

  - Regex:   '^<[a-z_]*>'
Priority:5
  - Regex:   '^<[A-Za-z_]*>'
Priority:4

Unfortunately, `#include ` matches the first regex and so Qt headers 
get sorted in with system headers. Would it be possible to add the option to do 
case-sensitive matching after all? Should I open a new issue?

For anyone else who wants case-sensitive matching, I just did discover that 
`(?-i)` seems to do the trick. I thought it wouldn't because the docs mention 
extended regex, but I guess it's more extended than I thought! Using 
`'(?-i)^<[a-z_]*>'` does the trick for me.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D33932/new/

https://reviews.llvm.org/D33932



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits