Re: Issue 1235 in include-what-you-use: New IWYU pragma for extension point patterns

0 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
May 17, 2023, 11:55:58 AM5/17/23
to include-wh...@googlegroups.com
Comment #11 on issue 1235 by kadircet: New IWYU pragma for extension point patterns
https://github.com/include-what-you-use/include-what-you-use/issues/1235

gentle ping


notifi...@include-what-you-use.org

unread,
May 17, 2023, 12:22:58 PM5/17/23
to include-wh...@googlegroups.com
Comment #12 on issue 1235 by kimgr: New IWYU pragma for extension point patterns
https://github.com/include-what-you-use/include-what-you-use/issues/1235

Hey, sorry about the delay. A bit scatterbrained.

> Having "always_" as a prefix helps me (and also the tools) that this is a keep pragma that should
> apply "always", which tells me it's for the file rather than something in the file.

This triggered a few new ideas:

* `global_keep` -- don't really like this because "global" has idiomatic meaning in C++
* `universal_keep` -- fixes the above
* `keep_file` -- is probably my favorite now. It spells out exactly what is to be expected

Thoughts there?


notifi...@include-what-you-use.org

unread,
May 22, 2023, 3:44:18 AM5/22/23
to include-wh...@googlegroups.com
Comment #13 on issue 1235 by kadircet: New IWYU pragma for extension point patterns
https://github.com/include-what-you-use/include-what-you-use/issues/1235

thanks (and sorry for the late reply from my side too, last week has been a little hectic).

yeah `keep_file` also sounds better to me, but i again have a technical hesitation about that one :/. in theory these pragmas can show up as: `#include "foo.h" // IWYU pragma: keep because really important reason`.

hence it's likely that certain implementations only look for a comment that has substring `IWYU pragma: keep` which will also match `// IWYU pragma: keep_file` (at least clangd does, and current IWYU also seem to check for a [substr](https://github.com/include-what-you-use/include-what-you-use/blob/master/iwyu_preprocessor.cc#LL433C15-L433C15)).

So I think we can't really introduce any pragmas that share the same prefix (for backwards compatibility concerns).

Therefore it leaves us with the option of `universal_keep` or `always_keep`, i still feel like the latter conveys the content better. As `universal` (at least to me) is a concept that is not as intuitive. But I'd really like to make progress here, so if you feel strongly against `always`, I am fine to roll with that one too.


notifi...@include-what-you-use.org

unread,
May 22, 2023, 5:39:09 AM5/22/23
to include-wh...@googlegroups.com
Comment #14 on issue 1235 by kimgr: New IWYU pragma for extension point patterns
https://github.com/include-what-you-use/include-what-you-use/issues/1235

The reason I prefer `universal` or `global` to `always` is that the former denotes space where the latter denotes time. But yeah, "universal" doesn't exactly roll off the tongue.

I don't want to stall this any longer either, so let's go with `always_keep`. Thanks for moving this forward!


notifi...@include-what-you-use.org

unread,
May 22, 2023, 10:03:55 AM5/22/23
to include-wh...@googlegroups.com
Comment #15 on issue 1235 by kadircet: New IWYU pragma for extension point patterns
https://github.com/include-what-you-use/include-what-you-use/issues/1235

thanks a lot! i've updated the PR (to re-trigger CI)


Reply all
Reply to author
Forward
0 new messages