[PATCH] D112996: [CodeCompletion] Generally consider header files without extension

Christian Kandeler via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 3 05:43:46 PDT 2021


ckandeler updated this revision to Diff 384407.
ckandeler added a comment.

Limited the matching to Qt headers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112996

Files:
  clang/lib/Sema/SemaCodeComplete.cpp


Index: clang/lib/Sema/SemaCodeComplete.cpp
===================================================================
--- clang/lib/Sema/SemaCodeComplete.cpp
+++ clang/lib/Sema/SemaCodeComplete.cpp
@@ -9615,6 +9615,7 @@
       }
     }
 
+    const StringRef &Dirname = llvm::sys::path::filename(Dir);
     std::error_code EC;
     unsigned Count = 0;
     for (auto It = FS.dir_begin(Dir, EC);
@@ -9648,7 +9649,9 @@
           if (!(Filename.endswith_insensitive(".h") ||
                 Filename.endswith_insensitive(".hh") ||
                 Filename.endswith_insensitive(".hpp") ||
-                Filename.endswith_insensitive(".inc")))
+                Filename.endswith_insensitive(".inc") ||
+                Dirname == "Headers" ||
+                Dirname.startswith("Qt") || Dirname == "ActiveQt"))
             break;
         }
         AddCompletion(Filename, /*IsDirectory=*/false);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112996.384407.patch
Type: text/x-patch
Size: 894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211103/1d015fdb/attachment.bin>


More information about the cfe-commits mailing list