diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp index 401322f948..5e34c8883b 100644 --- a/cmake.config/iwyu/mapping.imp +++ b/cmake.config/iwyu/mapping.imp @@ -2,19 +2,6 @@ { ref: "c99.imp" }, { ref: "posix.imp" }, - # Generated to normal headers with a different name: header.h.generated.h -> nvim/some_other_header.h - { include: [ '"api/private/dispatch_wrappers.h.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, - { include: [ '"keysets.h.generated.h"', private, '"nvim/api/private/helpers.h"', public ] }, - { include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/defs.h"', public ] }, - { include: [ '"os/env.h.generated.h"', private, '"nvim/os/os.h"', public ] }, - { include: [ '"os/mem.h.generated.h"', private, '"nvim/os/os.h"', public ] }, - { include: [ '"os/stdpaths.h.generated.h"', private, '"nvim/os/os.h"', public ] }, - { include: [ '"os/users.h.generated.h"', private, '"nvim/os/os.h"', public ] }, - { include: [ '"ui_events_call.h.generated.h"', private, '"nvim/ui.h"', public ] }, - { include: [ '"ui_events_client.h.generated.h"', private, '"nvim/ui_client.h"', public ] }, - { include: [ '"ui_events_remote.h.generated.h"', private, '"nvim/api/ui.h"', public ] }, - - # Symbols { symbol: [ "FUNC_ATTR_ALLOC_ALIGN", private, '"nvim/func_attr.h"', public ] }, { symbol: [ "FUNC_ATTR_ALLOC_SIZE", private, '"nvim/func_attr.h"', public ] }, { symbol: [ "FUNC_ATTR_ALLOC_SIZE_PROD", private, '"nvim/func_attr.h"', public ] }, @@ -31,13 +18,12 @@ { symbol: [ "FUNC_ATTR_PURE", private, '"nvim/func_attr.h"', public ] }, { symbol: [ "FUNC_ATTR_UNUSED", private, '"nvim/func_attr.h"', public ] }, { symbol: [ "FUNC_ATTR_WARN_UNUSED_RESULT", private, '"nvim/func_attr.h"', public ] }, - { symbol: [ "MAX", private, '"nvim/macros.h"', public ] }, { symbol: [ "MIN", private, '"nvim/macros.h"', public ] }, { symbol: [ "extern_proc", private, '', public ] }, { symbol: [ "iovec", private, '', public ] }, - # Third party headers + { include: [ '"keysets_defs.generated.h"', private, '"nvim/api/private/dispatch.h"', public ] }, { include: [ '', private, '', public ] }, ] diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c index ab33bc6801..d2475150f7 100644 --- a/src/nvim/api/autocmd.c +++ b/src/nvim/api/autocmd.c @@ -10,6 +10,7 @@ #include "nvim/api/autocmd.h" #include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/validate.h" #include "nvim/autocmd.h" diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index 98074da139..a05d75e3e6 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -8,6 +8,7 @@ #include "nvim/api/extmark.h" #include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/validate.h" #include "nvim/buffer_defs.h" diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index f151a635ab..6b9d3d1130 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -5,6 +5,7 @@ #include "nvim/api/keysets.h" #include "nvim/api/options.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/validate.h" #include "nvim/autocmd.h" diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h index 49332bfecc..0a651ebd1c 100644 --- a/src/nvim/api/private/dispatch.h +++ b/src/nvim/api/private/dispatch.h @@ -26,6 +26,6 @@ extern const MsgpackRpcRequestHandler method_handlers[]; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/dispatch.h.generated.h" -# include "api/private/dispatch_wrappers.h.generated.h" +# include "api/private/dispatch_wrappers.h.generated.h" // IWYU pragma: export # include "keysets_defs.generated.h" #endif diff --git a/src/nvim/api/ui.h b/src/nvim/api/ui.h index ecfbb2d9f6..3d9152e0a4 100644 --- a/src/nvim/api/ui.h +++ b/src/nvim/api/ui.h @@ -10,5 +10,5 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/ui.h.generated.h" -# include "ui_events_remote.h.generated.h" +# include "ui_events_remote.h.generated.h" // IWYU pragma: export #endif diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index bec369b907..ee9e75f183 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -5,6 +5,7 @@ #include "nvim/api/extmark.h" #include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/win_config.h" #include "nvim/ascii.h" diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 1fb7eaba95..44c1c5595c 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -5,6 +5,7 @@ #include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/validate.h" #include "nvim/api/window.h" diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index e3f5987bd6..aee62f6104 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -10,6 +10,7 @@ #include "klib/kvec.h" #include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/validate.h" #include "nvim/ascii.h" diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index 94c93b436d..0b88ebf965 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -13,6 +13,7 @@ #include "nvim/api/keysets.h" #include "nvim/api/private/converter.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/buffer_defs.h" diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h index e0c970f20c..cbc2be47e0 100644 --- a/src/nvim/os/os.h +++ b/src/nvim/os/os.h @@ -11,10 +11,12 @@ #include "nvim/os/stdpaths_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS +// IWYU pragma: begin_exports # include "os/env.h.generated.h" # include "os/mem.h.generated.h" # include "os/stdpaths.h.generated.h" # include "os/users.h.generated.h" +// IWYU pragma: end_exports #endif #define ENV_LOGFILE "NVIM_LOG_FILE" diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 3feb0bf603..e54c3f2435 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -122,7 +122,7 @@ typedef struct ui_event_callback { // uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui.h.generated.h" -# include "ui_events_call.h.generated.h" +# include "ui_events_call.h.generated.h" // IWYU pragma: export #endif // uncrustify:on diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index db1ab463f8..4fcccf04b2 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -39,6 +39,6 @@ EXTERN bool ui_client_forward_stdin INIT( = false); // uncrustify:off #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_client.h.generated.h" -# include "ui_events_client.h.generated.h" +# include "ui_events_client.h.generated.h" // IWYU pragma: export #endif // uncrustify:on