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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 2 06:11:52 PDT 2021


sammccall added a comment.

> the files are located in include directories

These are directories that **may** contain headers, not directories that **only** contain headers. (Which we mostly expect `-Isystem` to be).
For example, many projects keep headers next to sources, and so have sources on their include path. And the directory containing the current file is always on the include path.
We'd expect to see `Makefile`, `SConstruct`, `BUILD` files etc here. And maybe a smattering of "random" files that don't follow particular conventions.

Trying to support QT headers seems very reasonable though. Seems like our options are:

- current behavior with false negatives on QT
- proposed behavior with false positives on Makefile etc
- current behavior and try to detect QT as an exception
- proposed behavior and try to detect Makefile etc as exceptions

WDYT about detecting QT headers specifically? It seems hacky, but I don't see a way out of this that doesn't involve hardcoding some filenames. Are they in a directory like `"qt-11/QFoo"` that we can recognize? Even Q followed by another capital letter might be a good enough heuristic.
(The docs suggest it's just `<QFoo>` but the docs also say to use angle brackets so I'm not sure whether to believe them)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112996



More information about the cfe-commits mailing list